【发布时间】:2015-04-04 03:30:26
【问题描述】:
我正在开发 Visual Studio 2013 应用程序,因此我需要包含 openssl 库。
到目前为止我做了什么:
我从这里下载了 VS2013 openssl-1.0.1l-vs2013.7z 的预编译 openssl 库:http://www.npcglib.org/~stathis/blog/precompiled-openssl/(最新稳定条目 MSVC2013)
包含 openssl 的包含目录到 C/C++/General/Additional 包含目录
将
lib64/libeay32MTd.lib和lib64/ssleay32MTd.lib添加到链接器/输入/附加依赖项我以这种方式调用 openssl 标头:
#include <openssl\pem.h>(例如)
我在带有多线程运行时库 (/MTd) 的 64 位 Windows 机器上使用 VS 2013。每次我想构建我的项目时,它都会给我以下错误:
错误 LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_BIO_new_mem_buf" in Funktion "__catch$?decrypt@cipherEngine@@QAE?AV?$basic_string@DU?$char_traits@D@std@@ V?$allocator@D@2@@std@@PADH@Z$4".
错误 LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RSA_private_decrypt" in Funktion "__catch$?decrypt@cipherEngine@@QAE?AV?$basic_string@DU?$char_traits@D@std@@ V?$allocator@D@2@@std@@PADH@Z$4".
错误 LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_PEM_read_bio_RSAPrivateKey" in Funktion "__catch$?decrypt@cipherEngine@@QAE?AV?$basic_string@DU?$char_traits@D@std@@ V?$allocator@D@2@@std@@PADH@Z$4".
error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: class std::basic_string,class std::allocator > __thiscall cipherEngine::rsaPrivateDecrypt(class std::basic_string,class std: :allocator >)" (?rsaPrivateDecrypt@cipherEngine@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V23@@Z)" 在 Funktion ""public: bool __thiscall cipherEngine::alterKey(class std::basic_string,class std::allocator >)" (?alterKey@cipherEngine@@QAE_NV?$basic_string@DU?$char_traits@D@std@@V?$分配器@D@2@@std@@@Z)"。
致命错误 LNK1120: 4 nicht aufgelöste Externe
谁知道“缺失的链接”?
【问题讨论】:
-
因为非德语母语人士可能难以理解德语错误消息:这些链接器错误抱怨对
BIO_new_mem_buf、RSA_private_decrypt、PEM_read_bio_RSAPrivateKey和cipherEngine::rsaPrivateDecrypt的未定义引用。 -
您的链接行中似乎缺少加密模块。我没有在 Windows 上做过,但如果命名方案有任何指示,库将类似于:
lib64/crypto32MTd.lib
标签: c++ visual-studio-2013 openssl