【问题标题】:Link unresolved error with VS2008 Boost ASIO and OpenSSL使用 VS2008 Boost ASIO 和 OpenSSL 链接未解决的错误
【发布时间】:2013-01-11 20:44:58
【问题描述】:

我已经从BoostPro 下载了 Boost 1.51 版。安装程序似乎有点不稳定,但我想我设法下载了大部分 1.51 文件。对于丢失的文件,我找到了另一个 link 并设法下载了其余的文件。我还下载了 OpenSSL 版本 j 64 位版本。我正在尝试从此example client code 构建代码。链接器生成 51 个未解决的外部错误。以下是前 20 个,看起来至少与其他人抱怨的错误有些相似:

1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _ERR_reason_error_string referenced in function "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall boost::asio::error::detail::ssl_category::message(int)const " (?message@ssl_category@detail@error@asio@boost@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _ERR_get_error referenced in function "public: __thiscall boost::asio::ssl::context::context(enum boost::asio::ssl::context_base::method)" (??0context@ssl@asio@boost@@QAE@W4method@context_base@123@@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSLv23_server_method referenced in function "public: __thiscall boost::asio::ssl::context::context(enum boost::asio::ssl::context_base::method)" (??0context@ssl@asio@boost@@QAE@W4method@context_base@123@@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSLv23_client_method referenced in function "public: __thiscall boost::asio::ssl::context::context(enum boost::asio::ssl::context_base::method)" (??0context@ssl@asio@boost@@QAE@W4method@context_base@123@@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSLv23_method referenced in function "public: __thiscall boost::asio::ssl::context::context(enum boost::asio::ssl::context_base::method)" (??0context@ssl@asio@boost@@QAE@W4method@context_base@123@@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _TLSv1_server_method referenced in function "public: __thiscall boost::asio::ssl::context::context(enum boost::asio::ssl::context_base::method)" (??0context@ssl@asio@boost@@QAE@W4method@context_base@123@@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _TLSv1_client_method referenced in function "public: __thiscall boost::asio::ssl::context::context(enum boost::asio::ssl::context_base::method)" (??0context@ssl@asio@boost@@QAE@W4method@context_base@123@@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _TLSv1_method referenced in function "public: __thiscall boost::asio::ssl::context::context(enum boost::asio::ssl::context_base::method)" (??0context@ssl@asio@boost@@QAE@W4method@context_base@123@@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSLv3_server_method referenced in function "public: __thiscall boost::asio::ssl::context::context(enum boost::asio::ssl::context_base::method)" (??0context@ssl@asio@boost@@QAE@W4method@context_base@123@@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSLv3_client_method referenced in function "public: __thiscall boost::asio::ssl::context::context(enum boost::asio::ssl::context_base::method)" (??0context@ssl@asio@boost@@QAE@W4method@context_base@123@@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSLv3_method referenced in function "public: __thiscall boost::asio::ssl::context::context(enum boost::asio::ssl::context_base::method)" (??0context@ssl@asio@boost@@QAE@W4method@context_base@123@@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSLv2_server_method referenced in function "public: __thiscall boost::asio::ssl::context::context(enum boost::asio::ssl::context_base::method)" (??0context@ssl@asio@boost@@QAE@W4method@context_base@123@@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSLv2_client_method referenced in function "public: __thiscall boost::asio::ssl::context::context(enum boost::asio::ssl::context_base::method)" (??0context@ssl@asio@boost@@QAE@W4method@context_base@123@@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSL_CTX_new referenced in function "public: __thiscall boost::asio::ssl::context::context(enum boost::asio::ssl::context_base::method)" (??0context@ssl@asio@boost@@QAE@W4method@context_base@123@@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSLv2_method referenced in function "public: __thiscall boost::asio::ssl::context::context(enum boost::asio::ssl::context_base::method)" (??0context@ssl@asio@boost@@QAE@W4method@context_base@123@@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSL_CTX_free referenced in function "public: __thiscall boost::asio::ssl::context::~context(void)" (??1context@ssl@asio@boost@@QAE@XZ)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSL_CTX_set_ex_data referenced in function "public: __thiscall boost::asio::ssl::context::~context(void)" (??1context@ssl@asio@boost@@QAE@XZ)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSL_CTX_get_ex_data referenced in function "public: __thiscall boost::asio::ssl::context::~context(void)" (??1context@ssl@asio@boost@@QAE@XZ)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSL_CTX_set_verify referenced in function "public: class boost::system::error_code __thiscall boost::asio::ssl::context::set_verify_mode(int,class boost::system::error_code &)" (?set_verify_mode@context@ssl@asio@boost@@QAE?AVerror_code@system@4@HAAV564@@Z)
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSL_CTX_get_verify_callback referenced in function "public: class boost::system::error_code __thiscall boost::asio::ssl::context::set_verify_mode(int,class boost::system::error_code &)" (?set_verify_mode@context@ssl@asio@boost@@QAE?AVerror_code@system@4@HAAV564@@Z)

我在这里阅读了有关将 Boost 与 OpenSSL 链接的问题的其他问题,并尝试了建议的步骤来解决该问题。这包括:

  1. 将路径 C:\OpenSSL-Win64\include 添加到附加包含目录中。
  2. 将 C:\OpenSSL-Win64\lib\VC\static 添加到附加库目录。也尝试过指定 C:\OpenSSL-Win64\lib\VC\ 路径,结果相同。
  3. 将 libeay32MDd.lib 和 ssleay32MDd.lib 添加到 Additional Dependencies 以用于链接器的其他依赖项。

即使在执行上述操作后,我仍然会收到这些链接错误。我还尝试使用 __stdcall 而不是默认的 __cdecl 构建我的项目 - 这会在调用信号时出现编译错误,该信号需要 __cdecl;所以我不认为是这样。我已经尝试了我能想到的一切。有没有人知道我做错了什么或者我可以尝试什么来解决问题?

【问题讨论】:

    标签: visual-studio-2008 visual-c++ openssl boost-asio


    【解决方案1】:

    我最终设法通过构建 Boost ASIO 和 OpenSSL 库的 32 位版本来构建解决方案。我现在怀疑这是 Windows 64 位版本的 Boost::ASIO 中的一个错误,并已提交了bug report

    为了摆脱未解决的链接错误,还需要下载 VS2008 redistributables 的 32 位版本,以及 OpenSSL 的 32 位版本并针对 Boost 的 32 位版本构建。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-03
      • 2015-02-13
      • 1970-01-01
      • 2011-09-28
      • 1970-01-01
      • 2013-07-28
      • 1970-01-01
      相关资源
      最近更新 更多