Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

boost::asio ssl linking error

I'm using boost version 1.47, visual studio 2010, I downloaded the binaries for windows and linked to the include directory and lib directory from my project preferences. But I still can't use any ssl functionality from boost::asio.

This is the site where I downloaded the binaries: http://www.slproweb.com/products/Win32OpenSSL.html

I Downloaded: Visual C++ 2008 Redistributables and Win32 OpenSSL v1.0.1

These are the error messages I get:

Error   1   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) C:\Documents and Settings\Elias\my documents\visual studio 2010\Projects\OmniTcp\OmniTcp\main.obj   OmniTcp

Error   2   error LNK2001: unresolved external symbol _ERR_reason_error_string  C:\Documents and Settings\Elias\my documents\visual studio 2010\Projects\OmniTcp\OmniTcp\OmniTcp.obj    OmniTcp

Error   3   error LNK2019: unresolved external symbol _CRYPTO_set_id_callback referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::do_init(void)" (??0do_init@openssl_init_base@detail@ssl@asio@boost@@QAE@XZ)  C:\Documents and Settings\Elias\my documents\visual studio 2010\Projects\OmniTcp\OmniTcp\main.obj   OmniTcp

Error   4   error LNK2001: unresolved external symbol _CRYPTO_set_id_callback   C:\Documents and Settings\Elias\my documents\visual studio 2010\Projects\OmniTcp\OmniTcp\OmniTcp.obj    OmniTcp

Error   5   error LNK2019: unresolved external symbol _CRYPTO_set_locking_callback referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::do_init(void)" (??0do_init@openssl_init_base@detail@ssl@asio@boost@@QAE@XZ) C:\Documents and Settings\Elias\my documents\visual studio 2010\Projects\OmniTcp\OmniTcp\main.obj   OmniTcp

Error   6   error LNK2001: unresolved external symbol _CRYPTO_set_locking_callback  C:\Documents and Settings\Elias\my documents\visual studio 2010\Projects\OmniTcp\OmniTcp\OmniTcp.obj    OmniTcp

Error   25  error LNK1120: 12 unresolved externals  C:\Documents and Settings\Elias\my documents\visual studio 2010\Projects\OmniTcp\Debug\OmniTcp.exe  OmniTcp

I get a few more error messages but hey are all similar to eachother.

like image 280
user1064036 Avatar asked Mar 21 '12 12:03

user1064036


3 Answers

These are the libraries I linked to with boost 1.69, visual studio 2019, and OpenSSl-Win64:

libssl.lib;libcrypto.lib
like image 65
John Duffy Avatar answered Nov 15 '22 06:11

John Duffy


As mentioned in the comments to the question, my project linked once I added:

lib\libeay32.lib
lib\ssleay32.lib

To the Project->Configuration Properties->Linker->Input->Additional Dependencies property.

like image 3
cogitoboy Avatar answered Nov 15 '22 07:11

cogitoboy


Add the SSL dependencies (lib files) manually to project-->properties-->Linker-->Input-->Additional Dependencies.

like image 2
selalerer Avatar answered Nov 15 '22 07:11

selalerer