2013-01-11 72 views
1

我已经从BoostPro下载了Boost版本1.51。安装程序似乎有点片面,但我认为我设法下载了大部分1.51文件。对于丢失的文件,我找到了另外一个link,并设法下载了其他的文件。我也下载了OpenSSL版本j 64位版本。我试图从这个example client code建立代码。链接器生成51个未解决的外部错误。这里是前20,这似乎是至少有点类似错误,其他人都在抱怨:链接未解决的错误与VS2008 Boost ASIO和OpenSSL

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 " ([email protected][email protected]@[email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 
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)" ([email protected]@[email protected]@@[email protected]@[email protected]@@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)" ([email protected]@[email protected]@@[email protected]@[email protected]@@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)" ([email protected]@[email protected]@@[email protected]@[email protected]@@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)" ([email protected]@[email protected]@@[email protected]@[email protected]@@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)" ([email protected]@[email protected]@@[email protected]@[email protected]@@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)" ([email protected]@[email protected]@@[email protected]@[email protected]@@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)" ([email protected]@[email protected]@@[email protected]@[email protected]@@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)" ([email protected]@[email protected]@@[email protected]@[email protected]@@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)" ([email protected]@[email protected]@@[email protected]@[email protected]@@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)" ([email protected]@[email protected]@@[email protected]@[email protected]@@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)" ([email protected]@[email protected]@@[email protected]@[email protected]@@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)" ([email protected]@[email protected]@@[email protected]@[email protected]@@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)" ([email protected]@[email protected]@@[email protected]@[email protected]@@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)" ([email protected]@[email protected]@@[email protected]@[email protected]@@Z) 
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSL_CTX_free referenced in function "public: __thiscall boost::asio::ssl::context::~context(void)" ([email protected]@[email protected]@@[email protected]) 
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSL_CTX_set_ex_data referenced in function "public: __thiscall boost::asio::ssl::context::~context(void)" ([email protected]@[email protected]@@[email protected]) 
1>TestBoostASIO.obj : error LNK2019: unresolved external symbol _SSL_CTX_get_ex_data referenced in function "public: __thiscall boost::asio::ssl::context::~context(void)" ([email protected]@[email protected]@@[email protected]) 
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 &)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@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 &)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) 

我看过这里的其他问题有关链接使用OpenSSL加速的问题,已经尝试了建议的步骤解决这个问题。这包括:

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

即使执行上述操作后,我仍然会收到这些链接错误。我也尝试使用__stdcall而不是默认的__cdecl来构建我的项目 - 这给调用发出编译错误以期待__cdecl;所以我不认为这是事实。我尝试了所有我能想到的。有没有人有任何想法我做错了什么,或者我可以尝试什么来解决这个问题?

回答

1

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

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