![](/img/trans.png)
[英]#include excel error in C++ with Visual Studio 2015, Community edition
[英]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.