【问题标题】:Compiling OpenSSL for boost asio for Microsoft Visual Studio 2010为 Microsoft Visual Studio 2010 编译 OpenSSL for boost asio
【发布时间】:2011-01-02 02:50:13
【问题描述】:

我用 bjam 编译了 boost,然后编译了 OpenSSL。他们两个分开工作。

我在 Visual Studio 10 中设置了指向我的 OpenSSL 库目录的链接。

但是当我尝试编译示例 boost ssl asio 程序时,我得到了 44 个未解决的外部链接器错误,如下所示:

1>testing.obj:错误 LNK2019:未解析的外部符号 _SSLv23_server_method 在函数“public: void __thiscall boost::asio::ssl::detail::openssl_context_service::create(struct ssl_ctx_st * &,enum boost:: asio::ssl::context_base::method)" (?create@openssl_context_service@detail@ssl@asio@boost@@QAEXAAPAUssl_ctx_st@@W4method@context_base@345@@Z)

您能否提供有关正确链接 OpenSSL 到 boost 的分步说明?非常感谢

【问题讨论】:

  • 我不熟悉 Visual Studio 或 Windows,但是在 Linux 上使用 Boost.Asio 和 OpenSSL 时,您必须将 -lssl 添加到您的 LDFLAGS

标签: openssl boost-asio


【解决方案1】:

对于 VS 2008,将 C:\OpenSSL-Win32\includeC:\OpenSSL-Win32\lib 目录添加到 Visual Studio 的路径,然后将 ssleay32.lib libeay32.lib 添加到项目设置中的 Linker/Input/Additional Dependencies 选项。我会假设 VS 2010 是一样的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-21
    相关资源
    最近更新 更多