提升SSL与Visual Studio 2010和OpenSSL [英] Boost SSL with Visual Studio 2010 and OpenSSL

查看:1208
本文介绍了提升SSL与Visual Studio 2010和OpenSSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译升压1.47 ASIO SSL服务器和客户端的例子。我可以成功地整合加速到我的项目,但我不能合并的OpenSSL。当我尝试添加我得到的错误:

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:

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.

我曾尝试加入目录C:\\ OpenSSL的 - Win32的\\ lib目录\\,C:\\ OpenSSL的 - Win32的\\ lib目录\\ VC \\,C:\\ OpenSSL的 - Win32的\\ lib目录\\ VC \\静,C:\\的OpenSSL的Win32 \\ BIN,C:\\ OpenSSL的 - Win32的\\包括项目 - >常规属性 - >连接器 - >使用OpenSSL的pre-编译库附加库目录(http://www.openssl.org/related/binaries。 HTML)。我也曾尝试用同样的错误编译OpenSSL的自己。我真的很茫然,我已经试过我已搜查谷歌了一千倍的一切,试图IRC,目录的每个组合我能想到的...

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...

我的设置是:
Windows 7的64位
窗户Visual Studio 2010的64位
提升1.47
OpenSSL的1.0.0E和G
C / C ++附加包含目录:C:\\ Program Files文件(x86)的\\提升\\ boost_1_47; C:\\ OpenSSL的\\包括\\; C:\\ OpenSSL的 - Win32的\\ lib文件;%(AdditionalIncludeDirectories)
项目 - >常规属性 - >连接器 - >附加库目录:C:\\ Program Files文件(x86)的\\提升\\ boost_1_47 \\ lib中; C:\\ OpenSSL的\\ lib中; C:\\ OpenSSL的;%(AdditionalLibraryDirectories)
     - 我已经试过每个目录添加到这个属性以及....

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....

现在我只是想编译在VS C ++控制台项目如下:

Right now I'm just trying to compile the following in a VS C++ console project:

// SSLServer.cpp:定义控制台应用程序的入口点。
//

// 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;
}

先谢谢了。

推荐答案

看起来像您使用的是64位计算机上的OpenSSL的32位版本。

Looks like you're using the 32-bit version of OpenSSL on a 64-bit machine.

尝试从<一个下载64位版本(Win64中的OpenSSL v1.0.0g) href=\"http://www.slproweb.com/products/Win32OpenSSL.html\">http://www.slproweb.com/products/Win32OpenSSL.html

在所安装的(如果你使用默认路径),你应该有一个 C:\\ OpenSSL的 - Win64中文件夹

After that's installed (if you use default paths), you should have a C:\OpenSSL-Win64 folder.

您应该加上:


  • C:\\ OpenSSL的 - Win64的\\包含您附加包含目录

  • C:\\ OpenSSL的 - Win64的\\ lib目录\\ VC \\静态 C:\\ OpenSSL的 - Win64的\\ lib目录\\ VC ,具体取决于您是否希望静态库或DLL文件分别您的附加库目录

  • libeay32&LT; XXX&GT;的.lib ssleay32&LT; XXX&GT;的.lib 附加依赖其中,&LT; XXX&GT; 任何设置,您对 C / C ++]匹配 - &GT; [code代 - &GT;运行时库]

  • C:\OpenSSL-Win64\include to your Additional Include Directories
  • C:\OpenSSL-Win64\lib\VC\static or C:\OpenSSL-Win64\lib\VC to your Additional Library Directories depending on whether you want the static libs or the dlls respectively
  • libeay32<XXX>.lib and ssleay32<XXX>.lib to Additional Dependencies where <XXX> matches whatever setting you have for [C/C++]->[Code Generation]->[Runtime Library]

这篇关于提升SSL与Visual Studio 2010和OpenSSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆