Hi Victor,

> a) "-lssleay32 -llibeay32" Way:
>
>  At this moment in strawberry-perl-5.12.3.0-64bit / 5.12.2.0 and in 
> 64bit_openssl-1.0.0d-bin_20110507.zip :
> ==
> libeay32__.dll
> ssleay32__.dll
> libeay32.a
> libssl32.a
> libssleay32.a
> ==

I can give an explanation as I have prepared this part of strawberry perl.

a/ libeay32.a (+libeay32__.dll) is analogy for UNIXish -lcrypto

b/ libssl32.a == libssleay32.a (+ssleay32__.dll) is analogy for UNIXish -lssl

The trouble is that openssl has 2 different way for building MSWindows/gcc
libraries - one via Configure+make; the second via mingw32.bat.
Unfortunately each way creates *.a files with different names

*/ Configure+make creates
- libcrypto.dll.a
- libcrypto.a
- libssl.dll.a
- libssl.a

*/ mingw32.bat creates
- libeay32.a (= libcrypto.dll.a)
- libcrypto.a
- libssl32.a (= libssl.dll.a)
- libssl.a

On top of that you have also MS compiler (cl/msvc) in MS Windows world
which uses also different library names: libeay32*.lib ssleay32*.lib (from
here probably comes  "-lssleay32 -llibeay32" which should be fine with MS
compiler)

Things get a little bit more complicated by the fact that the more-or-less
official openssl Win32 binaries distribution (see
http://www.openssl.org/related/binaries.html) contains also mingw/gcc *.a
libraries - however named: libeay32.a + ssleay32.a (which does not
correspond to the results produced by the mingw.bat from official openssl
tarball). Please note that ssleay32.a is not libssleay32.a thus linker will
not find it when given -lssleay32 - this is IMHO the main source of
confusion about the right lib names.

What we have done in strawberry was to use naming convention
libeay32.a/libssl32.a + a little trick to copy libssl32.a to libssleay32.a
- at that time it seemed to be a way how to satisfy most of the modules on
cpan using different -lssleay32/-lssl32/-leay32 linker options

I do not feel to have an authority to say what is the best/right/correct
way but I would keep the naming convention of the original openssl
distribution and use: -lssl32 -leay32 for MSWindows+gcc compiler (which
works with openssl included in strawberry perl however not with *.a mingw
libraries that are part of the openssl Win32 binaries distribution).

--
kmx

Reply via email to