How to build app with source of openssl, without compiled openssl.dll
and libeay.dll
?
I downloaded openssl-0.9.8h
, set include paths to path-to-sources/include/.
Files located in include/openssl/
it's links to files ../../{crypto/_algo-name_/algosource.h}
, and VS do not understand this links.
-
I'm aware of how to compile openssl. The application compiles successfully and working with dll, but i need to compile and run without dll%) – r3l0c Jan 24 '14 at 13:48
-
I provided and answer (for all runtimes, x86/x64, debug/release) here http://stackoverflow.com/questions/18486243/how-do-i-build-openssl-statically-linked-against-windows-runtime/35494745#35494745 – Fernando Gonzalez Sanchez Feb 19 '16 at 01:23
2 Answers
Actually, you need to build OpenSSL and that will generate the library and header files in the patch specified in makefile. And you should use that include files. These header files are like template files and used while building OpenSSL. See this question.
And search how to build OpenSSL on Windows.
As the problem mentioned by you after compilation, there should not be any need of OpenSSL, you can do it in the following manner:
Generate static library of OpenSSL and use it in your application. Now, after compilation of your application, OpenSSL dlls will not be required.
If your application is very small, you can compile it with OpenSSL static library.

- 1
- 1

- 9,115
- 6
- 52
- 90
-
I do not generate headers for compileng and calling to dll's. I need compile with source. After compile that the application is not needed dll's. – r3l0c Jan 24 '14 at 11:44
-
Then generate static library of OpenSSL and use it. After compilation of your application with static library, you will not need OpenSSL's DLL. – doptimusprime Jan 24 '14 at 11:56
How to build app with source of openssl, without compiled openssl.dll and libeay.dll
You cannot. You need to build the OpenSSL library first.
I downloaded openssl-0.9.8h, set include paths to path-to-sources/include/....
Your next step is to open INSTALL.W32
and read the instructions. Here's an exceprt with most of the steps. But be sure to execute it using a Visual Studio Command Prompt so the tools like cl.exe
and link.exe
are on path.
If you want to compile in the assembly language routines with Visual
C++, then you will need already mentioned Netwide Assembler binary,
nasmw.exe or nasm.exe, to be available on your %PATH%.
Firstly you should run Configure with platform VC-WIN32:
> perl Configure VC-WIN32 --prefix=c:\some\openssl\dir
Where the prefix argument specifies where OpenSSL will be installed to.
Next you need to build the Makefiles and optionally the assembly
language files:
- If you are using NASM then run:
> ms\do_nasm
- If you don't want to use the assembly language files at all then run:
> perl Configure VC-WIN32 no-asm --prefix=c:/some/openssl/dir
> ms\do_ms
If you get errors about things not having numbers assigned then check the
troubleshooting section: you probably won't be able to compile it as it
stands.
Then from the VC++ environment at a prompt do:
> nmake -f ms\ntdll.mak
If all is well it should compile and you will have some DLLs and
executables in out32dll. If you want to try the tests then do:
> nmake -f ms\ntdll.mak test
To install OpenSSL to the specified location do:
> nmake -f ms\ntdll.mak install
Thomas Hruska of Shining Light Productions offers Win32 OpenSSL. Its a pre-built OpenSSL with a Windows installer. He's been providing it for years.
Once installed, just point to it in Visual Studio. There's no fussing with environments like Cygwin, Perl and scripts to modify source code so that Unix and Linux work on Windows. (That's a dumb idea to me. Windows is Windows, and Linux is Linux. Stop trying to make one act like the other).

- 97,681
- 90
- 411
- 885