[英]Including boost/asio.hpp throwing error
When I use #include in a header file, my program will no longer compile, giving the following error: 'boost::asio::basic_socket<Protocol,StreamSocketService>::cancel': By default, this function always fails with operation_not_supported when used on Windows XP, Windows Server 2003, or earlier. Consult documentation for details.
当我在头文件中使用#include时,我的程序将不再编译,并出现以下错误:
'boost::asio::basic_socket<Protocol,StreamSocketService>::cancel': By default, this function always fails with operation_not_supported when used on Windows XP, Windows Server 2003, or earlier. Consult documentation for details.
'boost::asio::basic_socket<Protocol,StreamSocketService>::cancel': By default, this function always fails with operation_not_supported when used on Windows XP, Windows Server 2003, or earlier. Consult documentation for details.
I am also using websocketpp in this project, if that is relevant - however the error only occurs if I include specifically in my header. 如果相关,我也在该项目中使用websocketpp-但是,仅当我在标题中特别包含该错误时,才会发生错误。
I am using Windows 10, Visual Studio 14. 我正在使用Windows 10,Visual Studio 14。
I'm at a loss as to why this error is occuring. 我不知道为什么会发生此错误。 I do not have to use the library at all, simply include it.
我根本不必使用该库,只需将其包含在内即可。
If you look at the header file, it's checking that _WIN32_WINNT
is at least 0x0600
. 如果查看头文件,它将检查
_WIN32_WINNT
至少为0x0600
。 Refering to this msdn page , you can decide which version to specify, eg 0x0600
for Windows Vista and above. 参考此msdn页面 ,您可以决定指定哪个版本,例如Windows Vista及更高版本的
0x0600
。 Specify this line before the include statement: 在include语句之前指定此行:
#define _WIN32_WINNT 0x0600
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.