我試圖編譯Boost 1.47 ASIO SSL服務器和客戶端示例。我可以成功地將Boost加入到我的項目中,但我無法加入OpenSSL。當我嘗試添加它,我得到的錯誤:使用Visual Studio 2010和OpenSSL提升SSL
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 " ([email protected][email protected]@[email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected])
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)" ([email protected][email protected]@[email protected]@[email protected]@[email protected])
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)" ([email protected][email protected]@[email protected]@[email protected]@[email protected])
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)" ([email protected][email protected]@[email protected]@[email protected]@[email protected])
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)" ([email protected][email protected]@[email protected]@[email protected]@[email protected])
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)" ([email protected][email protected]@[email protected]@[email protected]@[email protected])
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)" ([email protected][email protected]@[email protected]@[email protected]@[email protected])
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)" ([email protected][email protected]@[email protected]@[email protected]@QA[email protected])
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)" ([email protected][email protected]@[email protected]@[email protected]@[email protected])
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)" ([email protected][email protected]@[email protected]@[email protected]@[email protected])
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)" ([email protected][email protected]@[email protected]@[email protected]@[email protected])
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)" ([email protected][email protected]@[email protected]@[email protected]@[email protected])
1>C:\Users\Epicism\Documents\Visual Studio 2010\Projects\SSLServer\Debug\SSLServer.exe : fatal error LNK1120: 12 unresolved externals
1>
1>Build FAILED.
我曾嘗試加入目錄C:\的OpenSSL的Win32 \ LIB \,C:\的OpenSSL的Win32 \ LIB \ VC \,C:\ OpenSSL的-Win32 \ lib \ VC \ static,C:\ OpenSSL-Win32 \ bin,C:\ OpenSSL-Win32 \ include包含到Project-> General Properties-> Linker-> Additional Library Directories using the openssl pre-compiled libraries(http: //www.openssl.org/related/binaries.html)。我也嘗試用相同的錯誤編譯OpenSSL。我真的很茫然,我已經試過我已搜查谷歌了一千倍的一切,試圖IRC,目錄,我能想到的每一個組合...
我的設置是: Windows 7的64位 Windows Visual Studio 2010 64位 Boost 1.47 OpenSSL 1.0.0E和G C/C++其他包含目錄: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) - 我已經嘗試將每個目錄添加到此屬性以及....
現在我只是想編譯在VS C++控制檯項目如下:
// SSLServer.cpp:定義控制檯應用程序的入口點。 //
#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;
}
在此先感謝。
是的,我也是我有這個問題,因爲welll – jzeus 2012-06-30 06:01:07
我也有這個問題。有人設法弄清楚了嗎?如果是的話請回傳。下面試過弗雷澤的建議,但仍然有問題。 – 2013-01-12 00:55:21