Linking to openssl 64-bit static library

时间:2019-04-08 13:50:26

标签: c++ visual-studio openssl linker static-libraries

I'm using Visual Studio 2017 and I'm trying to link to openssl 1.0.2 built by me as 64-bit Release static library as shown here. Actually it's my lib (also static) that is using openssl functions directly and executable is linking to this lib. I tried two approaches:

  • Put openssl's symbols into mylib.lib (using a tab in VS mylib's project properties called "Librarian")
  • Link to openssl (libeay32.lib, ssleay32.lib) and to my lib using Linker in executable's project

Both are resulting in linker errors like

error LNK2001: unresolved external symbol EVP_EncryptInit_ex

concerning mylib.lib library.

I looked into libeay32.lib (also into mylib.lib while using the Librarian approach), using dumpbin.exe provided by Visual Studio, and there's _EVP_EncryptInit_ex (note the _ at the beggining) symbol defined. So I'm wondering whether it is possible that openssl defines _EVP_EncryptInit_ex and the executable is trying to link to EVP_EncryptInit_ex? What could be the cause and solution? Also: How can I check for sure what symbols is exectuable trying to link to?

0 个答案:

没有答案