title: Boost SSL with Visual Studio 2010 and OpenSSL
body: <p>I'm trying to compile the Boost 1.47 ASIO SSL server and client examples. I can sucessfully incorporate Boost into my project, but I cannot incorporate OpenSSL. When I try to add it I get the errors:</p>
  
  <pre><code>1&gt;SSLServer.obj : error LNK2019: unresolved external symbol _ERR_reason_error_string referenced in function "public: virtual class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; __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&gt;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&gt;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&gt;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&gt;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&gt;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&gt;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&gt;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&gt;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&gt;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&gt;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&gt;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&gt;C:\Users\Epicism\Documents\Visual Studio 2010\Projects\SSLServer\Debug\SSLServer.exe : fatal error LNK1120: 12 unresolved externals
  1&gt;
  1&gt;Build FAILED.
  </code></pre>
  
  <p>I have tried adding 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 to Project->General Properties->Linker->Additional Library Directories using the openssl pre-compiled libraries (http://www.openssl.org/related/binaries.html). I have also tried compiling OpenSSL myself with the same errors. I'm really at a loss, I have tried everything I have searched Google about a thousand times, tried IRC, every combination of directories I can think of...</p>
  
  <p>My setup is:
  Windows 7 64-bit
  Windows Visual Studio 2010 64 bit
  Boost 1.47
  OpenSSL 1.0.0E and G
  C/C++ Additional Include Directories: C:\Program Files (x86)\boost\boost_1_47;C:\openssl\include\;C:\OpenSSL-Win32\lib;%(AdditionalIncludeDirectories)
  Project->General Properties->Linker->Additional Library Directories: C:\Program Files (x86)\boost\boost_1_47\lib;C:\openssl\lib;C:\openssl;%(AdditionalLibraryDirectories)
      - I've tried adding every directory to this property as well....</p>
  
  <p>Right now I'm just trying to compile the following in a VS C++ console project:</p>
  
  <p>// SSLServer.cpp : Defines the entry point for the console application.
  //</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include &lt;boost/bind.hpp&gt;
  #include &lt;boost/asio.hpp&gt;
  #include &lt;boost/asio/ssl.hpp&gt;
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      return 0;
  }
  </code></pre>
  
  <p>Thanks in advance.</p>