hi,

i'm trying to compile openssl and zlib with visual studio 2010. the
problem is, at the end of the build process, ssltest gives me errors,
and so does xchat when i try to connect via ssl+zlib (using the binaries
built previously).

here's some debug info:

http://img155.imageshack.us/img155/490/zlibfail2.png

yes, it works with zlib1.dll, which is built with mingw (i guess) and
doesn't use wapi.

steps to reproduce:

--

1) install visual studio 2010

2) grab zlib 1.2.5 src:

http://zlib.net/zlib-1.2.5.tar.gz

extract it to somewhere. open contrib/vstudio/vc10/zlibvc.sln

3) in visual studio, set build config to win32/releasewithoutasm, then
press f7 (build solution). now zlibwapi.dll and zlibwapi.lib is built in
the x86 subfolder.

4) grab the openssl source code, i used 1.0.0d, for your convenience:

http://openssl.org/source/openssl-1.0.0d.tar.gz

extract it to somewhere.

5) create a folder called "zlib-x86" inside the openssl source code.
also create the bin, lib, include subfolders in zlib-x86.

6) copy your freshly built zlibwapi.dll to bin, zlibwapi.lib to lib, and
zlib.h + zconf.h to include.

7) download this script and save it to the openssl source code root as
build-x86.bat:

http://pastebin.com/RneQKMpC

modify it according to your setup (PERL_PATH, NASM_PATH). in case you
don't have them yet,

perl download:
http://www.activestate.com/activeperl/downloads

nasm:
http://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D

the install part contains some quirks but never mind, it's just for my
setup, and you won't need to install it anyway as it will already fail
in the testing stage.

8) open crypto\comp\c_zlib.c and replace the

zlib_dso = DSO_load(NULL, "ZLIB1", NULL, 0);

line with

zlib_dso = DSO_load(NULL, "ZLIBWAPI", NULL, 0);

here's a nicer *patch* for it (it should be committed imho):

http://pastebin.com/KRg7HFSq

9) open util\pl\VC-32.pl and replace this line:

$zlib_lib="zlib1.lib";

with

$zlib_lib="zlibwapi.lib";

this also shouldn't be hardcoded, but i can't provide a patch as i'm
unfamiliar with perl.

10) open a visual studio 2010 x86 command prompt and navigate to the
openssl source code root.

11) run build-x86.bat and wait for the tests to load. you should see
"zlib" when it displays "available compression". after a few tests
involving zlib windows will display an "ssltest.exe has stopped working"
message. if you then click the debug button, you'll see the same as what
i provided a shot of in the beginning of my message.

--

i'd like to point it out that the build process now only runs in 1
thread. it could be speeded up significantly by allowing multiple
processes to run simultaneously. all you need to do is add -MP to the
compiler flags in (ROOT)\Configure. i tested it with VC-WIN32 and
VC-WIN64A, it seems to work. any questions, please refer to:

http://msdn.microsoft.com/en-us/library/bb385193.aspx

--

greetings,

viktor
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to