I have downloaded Boost version 1.51 from BoostPro. The installer seems to be a little flaky, but I think I managed to download most of the 1.51 files. For the files that were missing, I found another link and managed to download the rest of those as well. I also downloaded OpenSSL version j 64 bit version. I am trying to build the code from this example client code. The linker generates 51 unresolved external errors. Here are the first 20, which appear to be at least somewhat similar to the errors others have complained about:
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)
I have read other questions here about the problem of linking Boost with OpenSSL and have tried the suggested steps to solve the problem. This includes:
- Added the path C:\OpenSSL-Win64\include to the Additional Include Directories.
- Added C:\OpenSSL-Win64\lib\VC\static to the Additional Library Directories. Have also tried specifying the C:\OpenSSL-Win64\lib\VC\ path as well, with the same result.
- Added libeay32MDd.lib and ssleay32MDd.lib to Additional Dependencies for the linker additional dependencies.
I still get these link errors even after doing the above. I have also tried building my project with __stdcall instead of the default __cdecl – which gave compile errors on the call to signal which is expecting __cdecl; so I don’t think that is it. I have tried everything I could think of. Does anyone have any ideas what I am doing wrong or what I can try that would fix the problem?
I finally managed to build the solution by building with the 32-bit versions of both the Boost ASIO and OpenSSL libraries. I now suspect that this is a bug in the Windows 64 bit version of Boost::ASIO and have submitted a bug report.
To get rid of the unresolved link errors, the 32 bit version of the VS2008 redistributables also need to be downloaded, along with the 32 bit version of OpenSSL and built against the 32 bit version of Boost.