Opened 13 years ago
Closed 13 years ago
#3017 closed Bugs (fixed)
ASIO Compile Errors on Visual Studio 2008, 64 bit
Reported by: | Owned by: | chris_kohlhoff | |
---|---|---|---|
Milestone: | Boost 1.40.0 | Component: | asio |
Version: | Boost 1.38.0 | Severity: | Problem |
Keywords: | Cc: |
Description
I've been getting and correcting these compile time errors since boost 1.34, finally decided to report them. Only occurs with Windows x64 builds.
boost/asio/detail/win_thread.hpp(151) : error C2664: 'QueueUserAPC' : cannot convert parameter 1 from 'void (cdecl *)(ULONG)' to 'PAPCFUNC'
None of the functions with this name in scope match the target type
boost/asio/detail/win_iocp_io_service.hpp(142) : error C2664: 'GetQueuedCompletionStatus' : cannot convert parameter 3 from 'DWORD *' to 'PULONG_PTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
boost/asio/detail/win_iocp_io_service.hpp(430) : error C2664: 'GetQueuedCompletionStatus' : cannot convert parameter 3 from 'DWORD *' to 'PULONG_PTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
The fixes are:
win_thread.hpp:151
::QueueUserAPC((PAPCFUNC) apc_function, thread_, 0);
win_iocp_io_service.hpp:135
#if (WINVER < 0x0500)
ULONG_PTR completion_key = 0;
#else
ULONG_PTR completion_key = 0;
#endif
win_iocp_io_service.hpp:422
#if (WINVER < 0x0500)
ULONG_PTR completion_key = 0;
#else
ULONG_PTR completion_key = 0;
#endif
Change History (3)
comment:1 by , 13 years ago
Component: | None → asio |
---|
comment:2 by , 13 years ago
comment:3 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Closing since there have been no further comments. The 64-bit Windows regression tests show no failures. Furthermore, the code has since been changed to default to the newer types (e.g. ULONG_PTR rather than ULONG) if WINVER is not defined.
This looks suspiciously like you're not using a recent enough value for WINVER. From memory, Win64 requires 0x502 or later (i.e. Windows Server 2003).