[Date Prev][Date Next]
(ITS#5603) Linking OpenSSL on Windows requires libgdi32 and libws2_32 after libcrypto
Full_Name: Ben Schmidt
OS: MinGW32, Mac OS X
Submission from: (NULL) (220.127.116.11)
My precise situation is, I am sure, a very uncommon scenario. However, it may
affect other building methods as well, and an appropriate fix I am sure could
help a few users.
Here's what I have been doing (please try not to laugh!): I have been
cross-compiling OpenLDAP on Mac OS X for MinGW32, including the SQL backend. I
have found two issues related to the configuration/build process.
I am afraid I really have no knowledge of GNU autoconf, so I will describe the
problem and my fixes, but with no pretense that they are appropriate for
applying to the code. I will suggest an appropriate way to fix it, but will have
to leave that work to another developer.
This is the second.
When linking OpenSSL on Windows, it is also necessary to link against libgdi32
and libws2_32 needs to be linked after libcrypto.
I worked around the problem with a simple substitution in configure:
s/-lcrypto/-lcrypto -lgdi32 -lws2_32
A more appropriate fix would be to make configure test first without these extra
libraries, and then with them, so that they are included if needed.
Note that configure will not fail if -lws2_32 is omitted, but building libldap
and libldap_r will fail later. I think it is probably safe to assume that if
-lgdi32 is needed, -lws2_32 will be (or at least available and not harmful to
A quick search and I couldn't find this issue already in your tracker.