簡體   English   中英

包括boost / asio.hpp拋出錯誤

[英]Including boost/asio.hpp throwing error

當我在頭文件中使用#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.

如果相關,我也在該項目中使用websocketpp-但是,僅當我在標題中特別包含該錯誤時,才會發生錯誤。

我正在使用Windows 10,Visual Studio 14。

我不知道為什么會發生此錯誤。 我根本不必使用該庫,只需將其包含在內即可。

如果查看頭文件,它將檢查_WIN32_WINNT至少為0x0600 參考此msdn頁面 ,您可以決定指定哪個版本,例如Windows Vista及更高版本的0x0600 在include語句之前指定此行:

#define _WIN32_WINNT 0x0600

暫無
暫無

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

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