1

Visual Studio 2010 で cpp-netlib を使用しようとしています。cpp-netlib をビルドし、プロジェクトに .lib ファイルを追加しましたが、コンパイルできません。

- 環境

  • ウィンドウズ 7 x64
  • cpp-netlib 0.11.0
  • ブースト 1.55.0
  • Win32 OpenSSL v1.0.1f

私のコードはここにあります。

#include <boost/network/protocol/http/client.hpp>
#include <iostream>

int main(int argc, char *argv[]) {
    using namespace boost::network;

    if (argc != 2) {
        std::cout << "Usage: " << argv[0] << " [url]" << std::endl;
        return 1;
    }

    http::client client;
    http::client::request request(argv[1]);
    request << header("Connection", "close");
    http::client::response response = client.get(request);
    std::cout << body(response) << std::endl;

    return 0;
}

cpp-netlib ライブラリ パスと cpp-netlib インクルード パスをプロジェクトに追加しました。ブーストと openssl パスも追加されました。ライブラリをプロジェクトに追加しました。

  • libboost_system-vc100-mt-gd-1_55.lib
  • libboost_date_time-vc100-mt-gd-1_55.lib
  • libboost_regex-vc100-mt-gd-1_55.lib
  • cppnetlib-client-connections.lib
  • cppnetlib-uri.lib

エラーは、OpenSSL に関連する何かから発生していると思います。

Error   55  error LNK2019: unresolved external symbol - function _BIO_ctrl ...

実は日本語版を持っているので下のような感じです。

エラー 55  error LNK2019: 未解決の外部シンボル _BIO_ctrl が関数 "public: class boost::system::error_code const & __thiscall boost::asio::ssl::detail::engine::map_error_code(class boost::system::error_code &)const " (?map_error_code@engine@detail@ssl@asio@boost@@QBEABVerror_code@system@5@AAV675@@Z) で参照されました。    cppnetlib-client-connections.lib(client.obj)    
エラー 57  error LNK2019: 未解決の外部シンボル _BIO_ctrl_pending が関数 "private: enum boost::asio::ssl::detail::engine::want __thiscall boost::asio::ssl::detail::engine::perform(int (__thiscall boost::asio::ssl::detail::engine::*)(void *,unsigned int),void *,unsigned int,class boost::system::error_code &,unsigned int *)" (?perform@engine@detail@ssl@asio@boost@@AAE?AW4want@12345@P812345@AEHPAXI@Z0IAAVerror_code@system@5@PAI@Z) で参照されました。    cppnetlib-client-connections.lib(client.obj)
エラー 43  error LNK2019: 未解決の外部シンボル _BIO_free が関数 "public: __thiscall boost::asio::ssl::detail::engine::~engine(void)" (??1engine@detail@ssl@asio@boost@@QAE@XZ) で参照されました。    cppnetlib-client-connections.lib(client.obj)    

私が欠けているものを教えていただけますか?プロジェクトにさらにライブラリを追加しようとしましたが、それでもうまくいきませんでした。

4

2 に答える 2

0

これら2つのライブラリを追加する必要があります。

libeay32.lib ssleay32.lib

于 2014-03-27T10:00:28.277 に答える