Build error on Windows with OpenLDAP

John Clizbe JPClizbe at tx.rr.com
Tue May 1 22:39:51 CEST 2007


If building GnuPG for Win32 with OpenLDAP instead of Win32's wlpda32, the wrong
header file is being included.

From configure:
configure: creating cache config.cache
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
<snip>
checking whether LDAP via "-lldap" is present and sane... no
checking whether I can make LDAP be sane with lber.h... yes
checking for ldap_get_option... yes
checking for ldap_set_option... yes
checking for ldap_start_tls_s... yes


$ make
gcc  -O3 -s -mms-bitfields -march=pentium3 -Wall -Wcast-align -Wshadow
-Wstrict-prototypes -Wformat-nonliteral -o gpgkeys_ldap.exe
gpgkeys_ldap-gpgkeys_ldap.o gpgkeys_ldap-ksutil.o ../util/libcompat.a  -lldap
   -lwsock32
gpgkeys_ldap-gpgkeys_ldap.o:gpgkeys_ldap.c:(.text+0xe25): undefined reference to
`_imp__ldap_modify_sA'
gpgkeys_ldap-gpgkeys_ldap.o:gpgkeys_ldap.c:(.text+0xe4f): undefined reference to
`_imp__ldap_add_sA'
gpgkeys_ldap-gpgkeys_ldap.o:gpgkeys_ldap.c:(.text+0xe6f): undefined reference to
`_imp__ldap_err2stringA'

The 'A' suffixed names are supplied by winldap.h, but that should only be
included if also linking with wldap32.dll.

I couldn't think of a non-fugly way to fix the source.

The section of keyserver/gpgkeys_ldap.c is
#ifdef _WIN32
#include <winsock2.h>
#include <winldap.h>
#else
#ifdef NEED_LBER_H
#include <lber.h>
#endif
/* For OpenLDAP, to enable the API that we're using. */
#define LDAP_DEPRECATED 1
#include <ldap.h>
#endif

Also, if including winsock2.h, shouldn't the linking be with -lws2_32 instead of
-lwsock32?


-- 
John P. Clizbe                      Inet:   John (a) Mozilla-Enigmail.org
You can't spell fiasco without SCO. PGP/GPG KeyID: 0x608D2A10/0x18BB373A
"what's the key to success?"        / "two words: good decisions."
"what's the key to good decisions?" /  "one word: experience."
"how do i get experience?"          / "two words: bad decisions."

"Just how do the residents of Haiku, Hawai'i hold conversations?"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 662 bytes
Desc: OpenPGP digital signature
Url : /pipermail/attachments/20070501/1bd5611b/attachment.pgp 


More information about the Gnupg-devel mailing list