OpenSSL is included as a static library, but is it still looking for a DLL?

I installed OpenSSL 1.0.0 on Windows using the installer, available at: http://www.slproweb.com/products/Win32OpenSSL.html

I added .lib files to my project (this is Visual Studio, added it to Project Settings-> Linker-> Input), and it compiles and works fine. But when I delete the OpenSSL DLL files in Windows \ system32, it complains that

"Debugger:: An unhandled non-continuable STATUS_DLL_NOT_FOUND exception was thrown during process load"

Any idea why she is still looking for a DLL, even when it is compiled with static libs? I do not reference the DLL anywhere in the project. The static libraries I included are libeay32.lib and ssleay32.lib.

Thanks, -M

+3
source share
3 answers

It searches for DLLs because the code loads dynamically at runtime. The code in static libraries is just a set of stub functions that are called in the DLL - they compare the sizes of the .lib and .dll files, and I'm sure you will see that the DLLs are much larger, since the bulk of the actual encryption code lies.

, , DLL. , , . , , . DLL - , .

+1

libeay32MT.lib 19 . , libeay32.lib - dll.

+3

:

http://www.ie7pro.com/openssl/openssl-0.9.8g_static_win32.zip

(. http://www.ie7pro.com/openssl.html).

They are built using static runtime libraries, so if you are using VC ++, you may need to go to:

Configuration Properties -> C / C ++ -> Code Generation -> Runtime Library

and select / MT instead of / MD to avoid link conflicts (or, alternatively, use / NODEFAULTLIB: LIBCMT, etc. in Linker -> Command Line -> Advanced Options).

+1
source

Source: https://habr.com/ru/post/1772574/


All Articles