1

I have a project that uses OpenSSL to send and receive on a socket connection. I have added libssl.lib and libcrypto.lib to my configuration.

Project Properties -> Linker -> Input -> Additional Dependencies

But when I use Visual Studio dumpbin tool to check for the imports it is wanting the Dlls:

libssl-1_1-x64.dll
libcrypto-1_1-x64.dll

I am not sure how to include those two files statically as I thought that was what I was doing?

Doritos
  • 403
  • 3
  • 16
  • https://stackoverflow.com/questions/32156336/how-to-include-openssl-in-visual-studio-expres-2012-windows-7-x64 – CristiFati Jan 17 '19 at 17:00

2 Answers2

0

This would depend on the OpenSSL distribution you are using. The Visual C++ linker doesn't understand .dll files so uses paired .lib files to define the entry points to a dll.

.lib files are, of course, a toolchain specific format so it is not generally desirable - or even possible - to distribute dll files and paired .lib files without specifying exactly which Visual C++ version they are intended to be used for.

So whatever you downloaded, or built, produced .lib files that are import libraries rather than actual static libraries. You need to check the documentation with the distro to see how to obtain the actual static libraries.

Chris Becke
  • 34,244
  • 12
  • 79
  • 148
0

If you build openssl yourself, Please link to *.lib with _static suffix.

libcrypto.lib => libcrypto_static.lib libssl.lib => libssl_static.lib

I confirmed this with openssl v1.1.1s, v1.1.1t, v3.0.7, v3.0.8

hitema
  • 1