compiling openssl in windows

Following are steps to compile openssl on windows.

Install active perl
download the openssl source and extract it. source code can be downloaded from https://www.openssl.org/source/


To compile openssl in 32 bit.
open command prompt
run vcvars32.bat in the command prompt. typical location of it (C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin)

perl Configure VC-WIN32 --prefix=C:\openssl32 no-asm
ms\do_ms
nmake -f ms\nt.mak
nmake -f ms\nt.mak install


To Compile openssl in 32 for Debug library

Open the Visual Studio Command Prompt (2010)

perl Configure debug-VC-WIN32 --prefix=C:\openssl32_debug no-asm
ms\do_ms
nmake -f ms\nt.mak
nmake -f ms\nt.mak install



Common Errors:

unresolved external symbol SSL_load_error_strings windows
unresolved external symbol SSL_library_init windows

While writing sample programs or using openssl library. above errors might come.

One reason for this errors, if perl Configure command is run without no-asm argument.

Second reason would be, wrong linking like 32 bit libraries are linked to 64 bit libraries or debug libraries are used with release libraries.

1 comment: