我正在尝试在 Windows 上构建 OpenLDAP。我这样做非常困难。
我开始按照概述的指示进行操作here http://www.openldap.org/faq/data/cache/302.html,但很快意识到它已经过时了。
然后我发现this https://bowmansolutions.com/mingw-openldap/,并意识到这也不完全正确。
我终于找到了this http://www.openldap.org/its/index.cgi/Incoming?id=8383;selectid=8383,并经历了这个家伙正在经历的确切错误。然而,当我尝试他的解决方案(注释掉 portable.h 中的第 1116 行)时,我遇到了更多问题。
有构建这个库的规范来源吗?
我在用着:
- Windows 7 专业版。
- Msys2(x86_64 20160205 来自here https://msys2.github.io/)
- OpenSSL(版本 1.0.1r 来自here https://www.openssl.org/source/old/1.0.1/openssl-1.0.1r.tar.gz)
- rxspencer(来自 alpha 3.8.g7here https://github.com/garyhouston/rxspencer/archive/alpha3.8.g7.tar.gz)
- OpenLDAP(版本 2.4.44 来自here ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.4.44.tgz)
Step 0:
编译rxspencer
./configure
make
make check
make install
Step 1:
使用 Visual Studio 2010 x64 命令提示符编译 OpenSSL
perl Configure no-ssl2 VC-WIN64A --prefix=d:\temp\openssl\x64
./ms/do_win64a.bat
nmake -f ms\nt.mak
nmake -f ms\ntdll.mak
cd out32
..\ms\test
Step 2:
修改路径,这样configure就能看到rxspencer
PATH=$PATH:/usr/local/lib
Step 3:
env \
CFLAGS="-I/usr/local/include/rxspencer" \
LD_LIBRARY_PATH="/c/work/openssl/lib:/usr/local/lib" \
LDFLAGS="-L/c/work/openssl/lib -L/usr/local/lib" \
CPPFLAGS="-I/c/work/openssl/include" \
LIBS="-lssl -lrxspencer" \
./configure \
--enable-shared \
--enable-static \
--with-tls \
--disable-bdb \
--disable-hdb \
2>&1 | tee output_config.log
这有效。出色的!
Step 4:
make depend 2>&1 | tee output_makedepend.log
这有效。出色的!
Step 5:
注释掉 include/portable.h 中的第 1116 行
Step 6:
make 2>&1 | tee output_make.log
观察出现的一堆错误,如下所示:
In file included from init.c:25:0:
back-mdb.h:71:2: error: unknown type name 'uint32_t'
uint32_t mi_dbenv_flags;
^
back-mdb.h:84:2: error: unknown type name 'uint32_t'
uint32_t mi_rtxn_size;
^
back-mdb.h:86:2: error: unknown type name 'uint32_t'
uint32_t mi_txn_cp_min;
^
back-mdb.h:87:2: error: unknown type name 'uint32_t'
uint32_t mi_txn_cp_kbyte;
^
init.c: In function 'mdb_db_open':
init.c:88:2: error: unknown type name 'uint32_t'
uint32_t flags;
Add:
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
到顶部
servers/slapd/back-mdb/back-mdb.h
再做一次...
现在我有一堆如下所示的错误:
symdummy.c:1:5: error: expected identifier or '(' before string constant
int ".refptr.ad_index_mutex"();
^
symdummy.c:2:5: error: expected identifier or '(' before string constant
int ".refptr.ad_undef_mutex"();
^
symdummy.c:3:5: error: expected identifier or '(' before string constant
int ".refptr.at_oc_cache"();
^
指出servers/slapd.def 出了什么问题?
我在这里做错了什么?我是否做错了什么并且构建在 Windows 上根本不起作用?