I am trying to compile examples of servers and clients of Boost 1.47 ASIO SSL and clients. I can successfully include Boost in my project, but I cannot include OpenSSL. When I try to add it, I get errors:
1>SSLServer.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>SSLServer.obj : 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 ) 1>SSLServer.obj : 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 ) 1>SSLServer.obj : error LNK2019: unresolved external symbol _CRYPTO_num_locks 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 ) 1>SSLServer.obj : error LNK2019: unresolved external symbol _SSL_load_error_strings 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 ) 1>SSLServer.obj : error LNK2019: unresolved external symbol _SSL_library_init 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 ) 1>SSLServer.obj : error LNK2019: unresolved external symbol _ENGINE_cleanup referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::~do_init(void)" ( ??1do_init@openssl _init_base@detail @ ssl@asio @ boost@ @ QAE@XZ ) 1>SSLServer.obj : error LNK2019: unresolved external symbol _CONF_modules_unload referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::~do_init(void)" ( ??1do_init@openssl _init_base@detail @ ssl@asio @ boost@ @ QAE@XZ ) 1>SSLServer.obj : error LNK2019: unresolved external symbol _CRYPTO_cleanup_all_ex_data referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::~do_init(void)" ( ??1do_init@openssl _init_base@detail @ ssl@asio @ boost@ @ QAE@XZ ) 1>SSLServer.obj : error LNK2019: unresolved external symbol _EVP_cleanup referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::~do_init(void)" ( ??1do_init@openssl _init_base@detail @ ssl@asio @ boost@ @ QAE@XZ ) 1>SSLServer.obj : error LNK2019: unresolved external symbol _ERR_remove_state referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::~do_init(void)" ( ??1do_init@openssl _init_base@detail @ ssl@asio @ boost@ @ QAE@XZ ) 1>SSLServer.obj : error LNK2019: unresolved external symbol _ERR_free_strings referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::~do_init(void)" ( ??1do_init@openssl _init_base@detail @ ssl@asio @ boost@ @ QAE@XZ ) 1>C:\Users\Epicism\Documents\Visual Studio 2010\Projects\SSLServer\Debug\SSLServer.exe : fatal error LNK1120: 12 unresolved externals 1> 1>Build FAILED.
I tried to add the directory C: \ OpenSSL-Win32 \ lib \, C: \ OpenSSL-Win32 \ lib \ VC \, C: \ OpenSSL-Win32 \ lib \ VC \ static, C: \ OpenSSL-Win32 \ bin, C: \ OpenSSL-Win32 \ include in Project-> General Properties-> Linker-> Additional libraries using pre-compiled openssl libraries (http://www.openssl.org/related/binaries.html). I also tried compiling OpenSSL with the same errors. I am really at a loss, I tried everything I searched on Google, about a thousand times, tried IRC, every combination of directories that I can think of ...
My setup: Windows 7 64-bit Windows 64-bit version of Visual Studio 2010 Boost 1.47 OpenSSL 1.0.0E and G C / C ++ Additional directories: C: \ Program Files (x86) \ boost \ boost_1_47; C: \ openssl \ include \; C: \ OpenSSL-Win32 \ lib;% (AdditionalIncludeDirectories) Project-> General Properties-> Linker-> Additional Libraries: C: \ Program Files (x86) \ boost \ boost_1_47 \ lib; C: \ openssl \ lib; C: \ openssl;% (AdditionalLibraryDirectories) - I tried adding all directories to this property ...
Now I'm just trying to compile the following in a VS C ++ console project:
//SSLServer.cpp: Defines the entry point for the console application. //
#include "stdafx.h" #include <cstdlib> #include <iostream> #include <boost/bind.hpp> #include <boost/asio.hpp> #include <boost/asio/ssl.hpp> int _tmain(int argc, _TCHAR* argv[]) { return 0; }
Thanks in advance.
source share