win7下mingw使用asio,报错 '::UnregisterWaitEx' has not been declared

D:\share\workspace/plato/externs/boost_1_54_0/boost/asio/detail/impl/win_object_handle_service.ipp: In member function 'void boost::asio::detail::win_object_handle_service::move_construct(boost::asio::detail::win_object_handle_service::implementation_type&, boost::asio::detail::win_object_handle_service::implementation_type&)':
D:\share\workspace/plato/externs/boost_1_54_0/boost/asio/detail/impl/win_object_handle_service.ipp:106:5: error: '::UnregisterWaitEx' has not been declared
D:\share\workspace/plato/externs/boost_1_54_0/boost/asio/detail/impl/win_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&)':
D:\share\workspace/plato/externs/boost_1_54_0/boost/asio/detail/impl/win_object_handle_service.ipp:158:5: error: '::UnregisterWaitEx' has not been declared
D:\share\workspace/plato/externs/boost_1_54_0/boost/asio/detail/impl/win_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&)':
D:\share\workspace/plato/externs/boost_1_54_0/boost/asio/detail/impl/win_object_handle_service.ipp:200:7: error: '::UnregisterWaitEx' has not been declared
D:\share\workspace/plato/externs/boost_1_54_0/boost/asio/detail/impl/win_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&)':
D:\share\workspace/plato/externs/boost_1_54_0/boost/asio/detail/impl/win_object_handle_service.ipp:251:7: error: '::UnregisterWaitEx' has not been declared
D:\share\workspace/plato/externs/boost_1_54_0/boost/asio/detail/impl/win_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&)':
D:\share\workspace/plato/externs/boost_1_54_0/boost/asio/detail/impl/win_object_handle_service.ipp:302:7: error: '::UnregisterWaitEx' has not been declared
D:\share\workspace/plato/externs/boost_1_54_0/boost/asio/detail/impl/win_object_handle_service.ipp: In member function 'void boost::asio::detail::win_object_handle_service::register_wait_callback(boost::asio::detail::win_object_handle_service::implementation_type&, boost::asio::detail::win_mutex::scoped_lock&)':
D:\share\workspace/plato/externs/boost_1_54_0/boost/asio/detail/impl/win_object_handle_service.ipp:376:44: error: 'RegisterWaitForSingleObject' was not declared in this scope
D:\share\workspace/plato/externs/boost_1_54_0/boost/asio/detail/impl/win_object_handle_service.ipp: In static member function 'static void boost::asio::detail::win_object_handle_service::wait_callback(PVOID, BOOLEAN)':
D:\share\workspace/plato/externs/boost_1_54_0/boost/asio/detail/impl/win_object_handle_service.ipp:402:5: error: '::UnregisterWaitEx' has not been declared
D:\share\workspace/plato/externs/boost_1_54_0/boost/asio/detail/impl/win_object_handle_service.ipp:418:48: error: 'RegisterWaitForSingleObject' was not declared in this scope
mingw32-make.exe[1]: *** [c:\temp/plato/objs/plato_network/Debug/TCPServerChannel.o] Error 1

mingw32-make.exe: *** [All] Error 2


可能是兼容性问题,需要加上声明 -D_WIN32_WINNT=0x0501 -DWINVER=0x0501


参考:http://boost.2283326.n4.nabble.com/boost-asio-UnregisterWaitEx-RegisterWaitForSingleObject-has-not-been-declared-td4633963.html



你可能感兴趣的:(win7下mingw使用asio,报错 '::UnregisterWaitEx' has not been declared)