boost:asio :: UnregisterWaitEx尚未声明 [英] boost:asio ::UnregisterWaitEx has not been declared

查看:731
本文介绍了boost:asio :: UnregisterWaitEx尚未声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在eclipse中编译一个基本的客户端/服务器C ++程序,使用Win7上的MinGW,使用 #include< boost / asio.hpp> / p>

I am trying to compile a basic client/server C++ program in eclipse with #include <boost/asio.hpp> using MinGW on Win7 and I get:

Description Resource    Path    Location    Type '::UnregisterWaitEx' has not been declared zion        line 106, external location: C:\boost_1_55_0\boost\asio\detail\impl\win_object_handle_service.ipp   C/C++ Problem

我包括路径C:\boost_1_55_0以及库boost_system和boost_asio。

I included the path C:\boost_1_55_0 as well as the libraries boost_system and boost_asio.

控制台输出:

 14:00:24 **** Incremental Build of configuration Debug for project boost_asio_test ****
Info: Internal Builder is used for build
g++ "-IC:\\boost_1_55_0\\" -O0 -g3 -Wall -c -fmessage-length=0 -o server.o "..\\server.cpp" 
In file included from C:\boost_1_55_0/boost/bind/bind.hpp:29:0,
                 from C:\boost_1_55_0/boost/bind.hpp:22,
                 from ..\server.cpp:11:
C:\boost_1_55_0/boost/bind/arg.hpp: In constructor 'boost::arg<I>::arg(const T&)':
C:\boost_1_55_0/boost/bind/arg.hpp:37:22: warning: typedef 'T_must_be_placeholder' locally defined but not used [-Wunused-local-typedefs]
         typedef char T_must_be_placeholder[ I == is_placeholder<T>::value? 1: -1 ];
                      ^
In file included from C:\boost_1_55_0/boost/asio/detail/win_object_handle_service.hpp:180:0,
                 from C:\boost_1_55_0/boost/asio/windows/object_handle_service.hpp:25,
                 from C:\boost_1_55_0/boost/asio/windows/basic_object_handle.hpp:27,
                 from C:\boost_1_55_0/boost/asio.hpp:108,
                 from ..\server.cpp:12:
C:\boost_1_55_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&)':
C:\boost_1_55_0/boost/asio/detail/impl/win_object_handle_service.ipp:106:5: error: '::UnregisterWaitEx' has not been declared
     ::UnregisterWaitEx(impl.wait_handle_, INVALID_HANDLE_VALUE);
     ^
C:\boost_1_55_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&)':
C:\boost_1_55_0/boost/asio/detail/impl/win_object_handle_service.ipp:158:5: error: '::UnregisterWaitEx' has not been declared
     ::UnregisterWaitEx(impl.wait_handle_, INVALID_HANDLE_VALUE);
     ^
C:\boost_1_55_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&)':
C:\boost_1_55_0/boost/asio/detail/impl/win_object_handle_service.ipp:200:7: error: '::UnregisterWaitEx' has not been declared
       ::UnregisterWaitEx(wait_handle, INVALID_HANDLE_VALUE);
       ^
C:\boost_1_55_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&)':
C:\boost_1_55_0/boost/asio/detail/impl/win_object_handle_service.ipp:251:7: error: '::UnregisterWaitEx' has not been declared
       ::UnregisterWaitEx(wait_handle, INVALID_HANDLE_VALUE);
       ^
C:\boost_1_55_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&)':
C:\boost_1_55_0/boost/asio/detail/impl/win_object_handle_service.ipp:302:7: error: '::UnregisterWaitEx' has not been declared
       ::UnregisterWaitEx(wait_handle, INVALID_HANDLE_VALUE);
       ^
C:\boost_1_55_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)':
C:\boost_1_55_0/boost/asio/detail/impl/win_object_handle_service.ipp:402:5: error: '::UnregisterWaitEx' has not been declared
     ::UnregisterWaitEx(impl->wait_handle_, NULL);
     ^
In file included from C:\boost_1_55_0/boost/asio/detail/impl/win_tss_ptr.ipp:24:0,
                 from C:\boost_1_55_0/boost/asio/detail/win_tss_ptr.hpp:76,
                 from C:\boost_1_55_0/boost/asio/detail/tss_ptr.hpp:25,
                 from C:\boost_1_55_0/boost/asio/detail/call_stack.hpp:20,
                 from C:\boost_1_55_0/boost/asio/impl/handler_alloc_hook.ipp:19,
                 from C:\boost_1_55_0/boost/asio/handler_alloc_hook.hpp:80,
                 from C:\boost_1_55_0/boost/asio/detail/handler_alloc_helpers.hpp:21,
                 from C:\boost_1_55_0/boost/asio/detail/bind_handler.hpp:19,
                 from C:\boost_1_55_0/boost/asio/detail/wrapped_handler.hpp:18,
                 from C:\boost_1_55_0/boost/asio/io_service.hpp:24,
                 from C:\boost_1_55_0/boost/asio/basic_io_object.hpp:19,
                 from C:\boost_1_55_0/boost/asio/basic_socket.hpp:20,
                 from C:\boost_1_55_0/boost/asio/basic_datagram_socket.hpp:20,
                 from C:\boost_1_55_0/boost/asio.hpp:21,
                 from ..\server.cpp:12:
C:\boost_1_55_0/boost/asio/error.hpp: At global scope:
C:\boost_1_55_0/boost/asio/error.hpp:252:45: warning: 'boost::asio::error::system_category' defined but not used [-Wunused-variable]
 static const boost::system::error_category& system_category
                                             ^
C:\boost_1_55_0/boost/asio/error.hpp:254:45: warning: 'boost::asio::error::netdb_category' defined but not used [-Wunused-variable]
 static const boost::system::error_category& netdb_category
                                             ^
C:\boost_1_55_0/boost/asio/error.hpp:256:45: warning: 'boost::asio::error::addrinfo_category' defined but not used [-Wunused-variable]
 static const boost::system::error_category& addrinfo_category
                                             ^
C:\boost_1_55_0/boost/asio/error.hpp:258:45: warning: 'boost::asio::error::misc_category' defined but not used [-Wunused-variable]
 static const boost::system::error_category& misc_category
                                             ^
In file included from C:\boost_1_55_0/boost/asio/io_service.hpp:28:0,
                 from C:\boost_1_55_0/boost/asio/basic_io_object.hpp:19,
                 from C:\boost_1_55_0/boost/asio/basic_socket.hpp:20,
                 from C:\boost_1_55_0/boost/asio/basic_datagram_socket.hpp:20,
                 from C:\boost_1_55_0/boost/asio.hpp:21,
                 from ..\server.cpp:12:
C:\boost_1_55_0/boost/asio/detail/winsock_init.hpp:116:30: warning: 'boost::asio::detail::winsock_init_instance' defined but not used [-Wunused-variable]
 static const winsock_init<>& winsock_init_instance = winsock_init<>(false);
                              ^
In file included from ..\server.cpp:9:0:
C:\boost_1_55_0/boost/system/error_code.hpp:222:36: warning: 'boost::system::posix_category' defined but not used [-Wunused-variable]
     static const error_category &  posix_category = generic_category();
                                    ^
C:\boost_1_55_0/boost/system/error_code.hpp:223:36: warning: 'boost::system::errno_ecat' defined but not used [-Wunused-variable]
     static const error_category &  errno_ecat     = generic_category();
                                    ^
C:\boost_1_55_0/boost/system/error_code.hpp:224:36: warning: 'boost::system::native_ecat' defined but not used [-Wunused-variable]
     static const error_category &  native_ecat    = system_category();
                                    ^

14:00:27 Build Finished (took 2s.579ms)

我试着看看.ipp但找不到任何非常有用的东西。某些东西没有被声明,但是我不知道boost.org文档中没有什么显着的。

I tried looking in the .ipp but couldn't find anything very helpful. Something isn't declared but I am not sure what and nothing stands out in the boost.org documentation.

我没有实际尝试实现任何其他升级代码因为它现在还没有编译,但这可能是需要做的?

I haven't actually tried to implement any other boost code yet as it is not compiling even now but that might be what needs to be done?

我现在的代码是一个使用winsock2的工作客户端/服务器,但我想让它在linux上工作。也许与winsock2代码和boost :: asio有冲突?

The code I have now is a working client/server using winsock2 but I'd like to have it work on linux as well. Perhaps there is a conflict with the winsock2 code and boost::asio?

推荐答案

对于eclipse,添加符号:_WIN32_WINNT val:0x0601 (或对于您的Windows系统: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745%28v=vs.85%29.aspx )来解决主要问题。

For eclipse, add symbol: _WIN32_WINNT val: 0x0601 (or for your windows system: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745%28v=vs.85%29.aspx) to resolve the primary issue.

WSAPOLLFD问题是由于: https://github.com/mozilla / rust / issues / 9246 && http://sourceforge.net/p/mingw/bugs/2049/ 这是补充:添加:

The WSAPOLLFD issue is due to: https://github.com/mozilla/rust/issues/9246 && http://sourceforge.net/p/mingw/bugs/2049/ which is patched by adding:

typedef struct pollfd {
  SOCKET fd;
  short  events;
  short  revents;
} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;

to winsock2.h。

to winsock2.h.

这篇关于boost:asio :: UnregisterWaitEx尚未声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆