使用Boost Asio时出错
Error while using Boost Asio
我得到"::UnregisterWaitEx未声明"在win_object_handle_service。每当我试图包含
目前我在Windows 8.1上使用Code::Blocks, MinGW编译器(没有与IDE捆绑在一起)。
Boost是在mingw include文件夹之外构建的,尽管它包含在项目设置中。
我得到的确切错误:
boost_1_58_0boostasiodetailimplwin_object_handle_service.ipp||In member function 'void boost::asio::detail::win_object_handle_service::move_construct(boost::asio::deta il::win_object_handle_service::implementation_type&, boost::asio::detail::win_object_handle_service::implementation_type&)':|
boost_1_58_0boostasiodetailimplwin_object_handle_service.ipp|106|error: '::UnregisterWaitEx' has not been declared|
boost_1_58_0boostasiodetailimplwin_object_handle_service.ipp||In member function 'void boost::asio::detail::win_object_handle_service::move_assign(boost::asio::detail::win_object_handle_service::implementation_type&, boost::asio::detail::win_object_handle_service&, boost::asio::detail::win_object_handle_service::implementation_type&)':|
boost_1_58_0boostasiodetailimplwin_object_handle_service.ipp|158|error: '::UnregisterWaitEx' has not been declared|
boost_1_58_0boostasiodetailimplwin_object_handle_service.ipp||In member function 'void boost::asio::detail::win_object_handle_service::destroy(boost::asio::detail::win_object_handle_service::implementation_type&)':|
boost_1_58_0boostasiodetailimplwin_object_handle_service.ipp|200|error: '::UnregisterWaitEx' has not been declared|
boost_1_58_0boostasiodetailimplwin_object_handle_service.ipp||In member function 'boost::system::error_code boost::asio::detail::win_object_handle_service::close(boost::asio::detail::win_object_handle_service::implementation_type&, boost::system::error_code&)':|
boost_1_58_0boostasiodetailimplwin_object_handle_service.ipp|251|error: '::UnregisterWaitEx' has not been declared|
boost_1_58_0boostasiodetailimplwin_object_handle_service.ipp||In member function 'boost::system::error_code boost::asio::detail::win_object_handle_service::cancel(boost::asio::detail::win_object_handle_service::implementation_type&, boost::system::error_code&)':|
boost_1_58_0boostasiodetailimplwin_object_handle_service.ipp|302|error: '::UnregisterWaitEx' has not been declared|
boost_1_58_0boostasiodetailimplwin_object_handle_service.ipp|402|error: '::UnregisterWaitEx' has not been declared|
boost_1_58_0boostsystemerror_code.hpp|221|warning: 'boost::system::posix_category' defined but not used [-Wunused-variable]|
boost_1_58_0boostsystemerror_code.hpp|222|warning: 'boost::system::errno_ecat' defined but not used [-Wunused-variable]|
boost_1_58_0boostsystemerror_code.hpp|223|warning: 'boost::system::native_ecat' defined but not used [-Wunused-variable]|
boost_1_58_0boostasioerror.hpp|258|warning: 'boost::asio::error::system_category' defined but not used [-Wunused-variable]|
boost_1_58_0boostasioerror.hpp|260|warning: 'boost::asio::error::netdb_category' defined but not used [-Wunused-variable]|
boost_1_58_0boostasioerror.hpp|262|warning: 'boost::asio::error::addrinfo_category' defined but not used [-Wunused-variable]|
boost_1_58_0boostasioerror.hpp|264|warning: 'boost::asio::error::misc_category' defined but not used [-Wunused-variable]|
boost_1_58_0boostasiodetailwinsock_init.hpp|116|warning: 'boost::asio::detail::winsock_init_instance' defined but not used [-Wunused-variable]|
我试过了:
- 设置_WIN32_WINNT为0x0601(只是增加了一个警告)
- 在winsock2.h中添加了pollfd结构体(没有任何变化) 链接boost正则表达式,系统和线程库(或至少尝试)
提前感谢,
尼克所以,我通过添加"-D_WIN32_WINNT=0x0501 -DWINVER=0x0501"来修复这个错误到两个编译器链接选项(在C::B)和#定义。我猜我添加了_WIN32_WINNT不知何故错误。
相关文章:
- 理解boost::asio-async_read在无需读取内容时的行为
- 访问者访问变体并返回不同类型时出错
- 在Linux for Windows上编译C++代码时出错
- 读取文件的最后一行并输入到链接列表时出错
- 提升 ASIO 无法识别计时器对象
- 重载操作程序时出错>>用于类中的字符串 memebr
- 调用专用模板时出错"no matching function for call to [...]"
- C++-试图将函数指针推回到另一个CPP文件中的矢量时出错
- 执行时使用 boost::asio::d eadline_timer 时出错
- 断开连接后重新连接boost beast(asio)websocket和http连接时出错
- 将 std::bind 应用于带有参数 <boost::asio::ip::tcp::socket> 时出错?
- 使用由 Mingw 5.3 编译的 boost ASIO 库使用 QT 时出错
- 在 Cygwin 64 上包含 boost.asio 时出错
- 使用 Boost::asio::async_send_to 发送加密数据时出错
- C2228:TCP asio 服务器出错
- LNK 2019使用Boost::asio时出错
- 编译Boost时出错.Asio示例代码
- 在basic_socket.hpp文件中使用lib boost asio 1.47.0时出错
- 读取文本文件片段并写入boost时出错.asio插座
- 使用Boost Asio时出错