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
I included the path C:\boost_1_55_0 as well as the libraries boost_system and boost_asio.
Console output:
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)
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?
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?