未解析的外部Symbol OpenSSL库C++

Gab*_*ser 1 c++ openssl visual-c++

我正在尝试使用Visual Studio 2013 C++编译我的程序,

在编译之前我没有错误.

error LNK2001: unresolved external symbol _EVP_DecryptUpdate
error LNK2001: unresolved external symbol _EVP_DecryptInit
error LNK2001: unresolved external symbol _EVP_DecryptFinal
error LNK2001: unresolved external symbol _EVP_CIPHER_CTX_new
error LNK2001: unresolved external symbol _EVP_CIPHER_CTX_init
error LNK2001: unresolved external symbol _EVP_CIPHER_CTX_free
error LNK2001: unresolved external symbol _EVP_CIPHER_CTX_cleanup
error LNK2001: unresolved external symbol _EVP_aes_128_cbc
Run Code Online (Sandbox Code Playgroud)

我正在使用股票OpenSSL库.我已成功将它们链接到openssl文件夹.

我该如何解决这个问题?

Gab*_*ser 8

摘自:在Visual Studio 2012中使用OpenSSL

UPDATE

This question helped me also in finding the solution. Boost SSL with Visual Studio 2010 and OpenSSL

The steps required to use the openSSL lib with VS2012:

  • download and install a version (I have 64bit OS, however I installed 32bit openssl) from http://slproweb.com/products/Win32OpenSSL.html.
  • New project in VS, then Configuration Properties/C/C++/General/Additional Include Directories: openssl include folder (C:\OpenSSL-Win32\include)
  • Linker/General/Additional Library Directiories: C:\OpenSSL-Win32\lib
  • Linker/Input/Additional Dependencies :
  • libeay32.lib libeay32MTd.lib libeay32MT.lib libeay32MDd.lib libeay32MD.lib ssleay32.lib ssleay32MTd.lib ssleay32MT.lib ssleay32MDd.lib ssleay32MD.lib

(It was written that I need to only add that one which matches with C/C++/Code Generation/Runtime Library, but It works me this way.)

将theese文件复制到当前的VS文件夹/ VC/lib中

这对我有所帮助


归档时间:

查看次数:

10219 次

最近记录:

10 年,3 月 前