未解析的外部Symbol OpenSSL库C ++ [英] Unresolved external Symbol OpenSSL Libraries C++
问题描述
我正在尝试使用Visual Studio 2013 C ++编译程序,
I'm trying to compile my program with Visual Studio 2013 C++,
在编译之前,我没有任何错误.
I have no errors until I compile.
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
我正在使用库存的OpenSSL库.我已经成功地将它们链接到openssl文件夹.
I'm using stock OpenSSL Libraries. I've successfully linked them to the openssl folder.
如何解决此问题?
推荐答案
来自:在Visual Studio 2012中使用OpenSSL
更新
这个问题也帮助我找到了解决方案.使用Visual Studio 2010和OpenSSL增强SSL
This question helped me also in finding the solution. Boost SSL with Visual Studio 2010 and OpenSSL
在VS2012中使用openSSL库所需的步骤:
The steps required to use the openSSL lib with VS2012:
- 下载并安装一个版本(我具有64位操作系统,但已安装 从 http://slproweb.com/products/Win32OpenSSL.html . >
- 在VS中创建新项目,然后进行配置 属性/C/C ++/常规/其他包含目录:openssl 包含文件夹(C:\ OpenSSL-Win32 \ include)
- 链接器/常规/附加库目录:C:\ OpenSSL-Win32 \ lib
- 链接器/输入/其他依赖项:
- libeay32.lib libeay32MTd.lib libeay32MT.lib libeay32MDd.lib libeay32MD.lib ssleay32.lib ssleay32MTd.lib ssleay32MT.lib ssleay32MDd.lib ssleay32MD.lib
- 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
(据写,我只需要添加一个与C/C ++/代码生成/运行时库匹配的代码,但是它可以这样工作.)
(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.)
将这些文件复制到当前VS文件夹/VC/lib
Copy theese files into current VS folder /VC/lib
这对我有帮助
这篇关于未解析的外部Symbol OpenSSL库C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!