簡體   English   中英

Visual Studio 2015社區版中發出cpp-netlib-0.9.4構建錯誤

[英]cpp-netlib-0.9.4 build error is emitted in Visual Studio 2015 Community edition

目前,我無法使用boost_1_60_0和openssl已經安裝來構建cpp-netlib-0.9.4。 您能給我一個有關如何解決此錯誤的建議嗎? 以下是發生錯誤時得到的日志。 供您參考,將include路徑和庫路徑設置為正確的目錄。

1>------ Build started: Project: cppnetlib-client-connections, Configuration: Debug Win32 ------
1>  Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23026 for x86
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1>
1>  cl /c /I"C:\codes\openssl-master\include\openssl" /I"C:\codes\openssl-master\include" /I"C:\codes\c++\cpp-netlib-0.9.4" /IC:\codes\c++\boost_1_60_0 /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D BOOST_NETWORK_DEBUG /D BOOST_NETWORK_ENABLE_HTTPS /D _SCL_SECURE_NO_WARNINGS /D _WIN32_WINNT=0x0501 /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cppnetlib-client-connections.dir\Debug\\" /Fd"cppnetlib-client-connections.dir\Debug\cppnetlib-client-connections.pdb" /Gd /TP /analyze- /errorReport:prompt "C:\codes\c++\cpp-netlib-0.9.4\libs\network\src\client.cpp"
1>
1>  client.cpp
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/detail/impl/openssl_init.ipp(47): error C2039: 'CRYPTO_set_id_callback': is not a member of '`global namespace''
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/detail/impl/openssl_init.ipp(47): error C3861: 'CRYPTO_set_id_callback': identifier not found
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/detail/impl/openssl_init.ipp(64): error C2039: 'CRYPTO_set_id_callback': is not a member of '`global namespace''
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/detail/impl/openssl_init.ipp(64): error C3861: 'CRYPTO_set_id_callback': identifier not found
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(58): error C2039: 'RSA_free': is not a member of '`global namespace''
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(58): error C3861: 'RSA_free': identifier not found
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(64): error C2039: 'DH_free': is not a member of '`global namespace''
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(64): error C3861: 'DH_free': identifier not found
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(83): error C2039: 'SSLv2_method': is not a member of '`global namespace''
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(83): error C3861: 'SSLv2_method': identifier not found
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(86): error C2039: 'SSLv2_client_method': is not a member of '`global namespace''
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(86): error C3861: 'SSLv2_client_method': identifier not found
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(89): error C2039: 'SSLv2_server_method': is not a member of '`global namespace''
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(89): error C3861: 'SSLv2_server_method': identifier not found
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(208): error C2027: use of undefined type 'ssl_ctx_st'
1>  C:\codes\openssl-master\include\openssl/ossl_typ.h(181): note: see declaration of 'ssl_ctx_st'
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(208): error C2227: left of '->default_passwd_callback_userdata' must point to class/struct/union/generic type
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(212): error C2027: use of undefined type 'ssl_ctx_st'
1>  C:\codes\openssl-master\include\openssl/ossl_typ.h(181): note: see declaration of 'ssl_ctx_st'
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(212): error C2227: left of '->default_passwd_callback_userdata' must point to class/struct/union/generic type
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(214): error C2027: use of undefined type 'ssl_ctx_st'
1>  C:\codes\openssl-master\include\openssl/ossl_typ.h(181): note: see declaration of 'ssl_ctx_st'
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(214): error C2227: left of '->default_passwd_callback_userdata' must point to class/struct/union/generic type
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(551): error C2027: use of undefined type 'ssl_ctx_st'
1>  C:\codes\openssl-master\include\openssl/ossl_typ.h(181): note: see declaration of 'ssl_ctx_st'
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(551): error C2227: left of '->default_passwd_callback' must point to class/struct/union/generic type
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(552): error C2027: use of undefined type 'ssl_ctx_st'
1>  C:\codes\openssl-master\include\openssl/ossl_typ.h(181): note: see declaration of 'ssl_ctx_st'
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(552): error C2227: left of '->default_passwd_callback_userdata' must point to class/struct/union/generic type
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(552): error C2660: 'PEM_read_bio_X509_AUX': function does not take 2 arguments
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(580): error C2027: use of undefined type 'ssl_ctx_st'
1>  C:\codes\openssl-master\include\openssl/ossl_typ.h(181): note: see declaration of 'ssl_ctx_st'
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(580): error C2227: left of '->default_passwd_callback' must point to class/struct/union/generic type
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(581): error C2027: use of undefined type 'ssl_ctx_st'
1>  C:\codes\openssl-master\include\openssl/ossl_typ.h(181): note: see declaration of 'ssl_ctx_st'
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(581): error C2227: left of '->default_passwd_callback_userdata' must point to class/struct/union/generic type
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(581): error C2660: 'PEM_read_bio_X509': function does not take 2 arguments
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(657): error C2027: use of undefined type 'ssl_ctx_st'
1>  C:\codes\openssl-master\include\openssl/ossl_typ.h(181): note: see declaration of 'ssl_ctx_st'
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(657): error C2227: left of '->default_passwd_callback' must point to class/struct/union/generic type
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(658): error C2027: use of undefined type 'ssl_ctx_st'
1>  C:\codes\openssl-master\include\openssl/ossl_typ.h(181): note: see declaration of 'ssl_ctx_st'
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(658): error C2227: left of '->default_passwd_callback_userdata' must point to class/struct/union/generic type
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(658): error C2660: 'PEM_read_bio_PrivateKey': function does not take 2 arguments
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(716): error C2027: use of undefined type 'ssl_ctx_st'
1>  C:\codes\openssl-master\include\openssl/ossl_typ.h(181): note: see declaration of 'ssl_ctx_st'
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(716): error C2227: left of '->default_passwd_callback' must point to class/struct/union/generic type
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(717): error C2027: use of undefined type 'ssl_ctx_st'
1>  C:\codes\openssl-master\include\openssl/ossl_typ.h(181): note: see declaration of 'ssl_ctx_st'
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(717): error C2227: left of '->default_passwd_callback_userdata' must point to class/struct/union/generic type
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(717): error C2660: 'PEM_read_bio_RSAPrivateKey': function does not take 2 arguments
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(936): error C2027: use of undefined type 'ssl_ctx_st'
1>  C:\codes\openssl-master\include\openssl/ossl_typ.h(181): note: see declaration of 'ssl_ctx_st'
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(936): error C2227: left of '->default_passwd_callback_userdata' must point to class/struct/union/generic type
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(938): error C2027: use of undefined type 'ssl_ctx_st'
1>  C:\codes\openssl-master\include\openssl/ossl_typ.h(181): note: see declaration of 'ssl_ctx_st'
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(938): error C2227: left of '->default_passwd_callback_userdata' must point to class/struct/union/generic type
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(940): error C2027: use of undefined type 'ssl_ctx_st'
1>  C:\codes\openssl-master\include\openssl/ossl_typ.h(181): note: see declaration of 'ssl_ctx_st'
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/impl/context.ipp(940): error C2227: left of '->default_passwd_callback_userdata' must point to class/struct/union/generic type
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/detail/impl/engine.ipp(207): error C2065: 'SSL_R_SHORT_READ': undeclared identifier
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/detail/impl/engine.ipp(208): error C2440: '<function-style-cast>': cannot convert from 'const boost::system::error_category' to 'boost::system::error_code'
1>  C:\codes\c++\boost_1_60_0\boost/asio/ssl/detail/impl/engine.ipp(208): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/detail/impl/engine.ipp(214): error C2027: use of undefined type 'ssl_st'
1>  C:\codes\openssl-master\include\openssl/ssl.h(320): note: see declaration of 'ssl_st'
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/detail/impl/engine.ipp(214): error C2227: left of '->version' must point to class/struct/union/generic type
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/detail/impl/engine.ipp(221): error C2065: 'SSL_R_SHORT_READ': undeclared identifier
1>C:\codes\c++\boost_1_60_0\boost/asio/ssl/detail/impl/engine.ipp(222): error C2440: '<function-style-cast>': cannot convert from 'const boost::system::error_category' to 'boost::system::error_code'
1>  C:\codes\c++\boost_1_60_0\boost/asio/ssl/detail/impl/engine.ipp(222): note: No constructor could take the source type, or constructor overload resolution was ambiguous

我與您有相同的問題,可能這個答案可以為您提供幫助

帶有錯誤“ CRYPTO_set_id_callback”,“ RSA_free”和“ DH_free”,因為這些函數定義了OPENSSL_USE_DEPRECATD。 您需要這樣的調用函數:(在boost / asio / ssl / detail / impl / openssl_init.ipp中編輯)

 #ifdef OPENSSL_USE_DEPRECATD
     ::CRYPTO_set_id_callback(0);
  #endif

與RSA_free和DH_free相同:

#ifdef OPENSSL_USE_DEPRECATED
   if(p)
   ::RSA_free(p)
#endif

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM