将openssl链接到visual studio 2013 LNK2019
linking openssl to visual studio 2013 LNK2019
我正在visual studio 2013应用程序上进行开发,因此我需要包含openssl库。
到目前为止我做了什么:
-
我从这里下载了VS2013 openssl-1.0.1l-VS2013.7z的预编译openssl库:http://www.npcglib.org/~stathis/blog/precompiled-openssl/(最新稳定条目MSVC2013)
-
included openssl的include目录到C/C++/General/Additional include目录
-
将
lib64/libeay32MTd.lib
和lib64/ssleay32MTd.lib
添加到链接器/输入/附加依赖 -
我这样调用openssl头:
#include <opensslpem.h>
(例如)
我在64位Windows主机上使用VS2013,带有多线程运行库(/MTd)。每次我想构建我的项目时,它都会给我以下错误:
错误LNK2019:函数"__catch$"中的Verweis auf不包含aufgelöstes外部符号"_BIO_new_mem_buf"?decrypt@cipherEngine@@QAE?AV$basic_string@DU$char_traits@D@std@@V$allocator@D@2@@std@@PADH@Z$4".
错误LNK2019:函数"__catch$"中的Verweis auf nicht aufgelöstes外部符号"_RSA_private_decrypt"?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 externates Symbol"_PEM_read_bio_RSAPrivateKey"__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 externals Symbol"public:class std::basic_string,class std::allocater>__thiscall cipherEngine::rsaPrivateDecrypt?rsaPrivateDecrypt@cipherEngine@@QAE?AV$basic_string@DU$char_traits@D@std@@V$allocator@D@2@@std@@V23@@Z)"在函数"public:bool __thiscall cipherEngine::alterKey(class std::basic_string,class std:::allocater>)"(?alterKey@cipherEngine@@QAE_NV$basic_string@DU$char_traits@D@std@@V$allocator@D@2@@std@@@Z)"。
致命错误LNK1120:4 nicht aufgelöste Externe
谁知道"缺失的环节"?
在向VS添加外部库时,我通常会尝试包含库源代码,并在自己的树中构建它们。这避免了我认为您看到的问题,即预编译库的编译选项与主项目略有不同。不同的选项会使库无法使用。
如果您真的不想在项目中编译lib,请尝试进一步研究这些符号,以确定编译变体。
我忘了定义rsaPrivateDecrypt
所属的类(真遗憾)。第二件事是使用32位库,而不是64位库。
- 将"libpqxx"与Visual Studio 2013链接/安装,以便与PostgrSQL建立C++连接
- Visual Studio 2013,错误 MSB8020:找不到 Visual Studio 2010 的生成工具
- 为什么在Visual Studio 2013上的std::this_thread::sleep_for上死锁
- 性能报告 (.vspx) 在 Visual Studio 2013 中未打开(显示损坏)
- 在 Visual Studio 2013 中使用零大小数组C++
- Visual Studio 2013 标头包含失败
- Visual studio 2013 和 g++ 7.1 中将 int 和 long 类型相乘时的 c++ 差异行为
- 在Visual Studio 2013中编译的STL列表代码在Visual Studio 2019中给出了错误.想知道原
- 错误 LNK2019: 未解析的外部符号 Visual Studio 2013 与 openCV
- cv:内存位置的异常 - 运行 openCV 代码 Visual Studio 2013 & Visual Studio 2017 - Windows 7
- 模块计算机类型和目标计算机类型 Visual Studio 2013
- 如何在Visual Studio 2013 Ultimate Edition中包含某个单词的每一行中插入断点
- 具有显式参数和大小的可变参数模板.Visual Studio 2013.
- 使用 Visual Studio 2013 编译 GDCM dlls 2.8.4 for Windows
- 基本字符串操作有问题 [c++, Visual Studio 2013]
- Visual Studio 2013中可能的C/C 编译器错误
- 在Visual Studio 2013上.Win32 应用和 CLR 应用
- 我正在尝试在Visual Studio 2013中编写我的第一个"Hello World"代码。为什么我会收到"IntelliSense: no operator message"和"error C2
- DLL不导出Visual Studio 2013 VB代码中的字符串
- 我们如何使用Visual Studio 2013访问C 中的更改编号