Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#2541 closed Bugs (fixed)

Asio not working on windows due to QueueUserAPC missing in global namespace

Reported by: Stephan Menzel <stephan.menzel@…> Owned by: chris_kohlhoff
Milestone: Boost 1.38.0 Component: asio
Version: Boost 1.37.0 Severity: Problem
Keywords: Cc:

Description

Hi Chris,

I just thought I open a ticket here for better handling: The problem has been described by someone else, but I have it too. It's quite simple, although perhaps not the solution. http://groups.google.tl/group/boost-list/browse_thread/thread/c19823879d3cdecc

Basically, Asio in 1.37 is not compiling on windows. I get the following error: 'QueueUserAPC' : is not a member of 'operatorglobal namespace

Greetings and Thanks...

Stephan

Change History (8)

comment:1 by Steven Watanabe, 14 years ago

Component: Noneasio
Owner: set to chris_kohlhoff

comment:2 by chris_kohlhoff, 14 years ago

This is due to _WIN32_WINNT not being defined when Windows.h is first included and/or the value of the #define being changed before asio.hpp is included. To work correctly, _WIN32_WINNT should be defined on the compiler command line or in the project options.

comment:3 by chris_kohlhoff, 14 years ago

Resolution: fixed
Status: newclosed

(In [50945]) Improve warning message when _WIN32_WINNT is not correctly defined. Fixes #2541.

comment:4 by Stephan Menzel <stephan.menzel@…>, 14 years ago

Resolution: fixed
Status: closedreopened

Hi Chris,

I'm not sure it's that easy. _WIN32_WINNT is set here in the project options (MSVC2005) and never changes it's value within my project as far as I can see.

Here's the cmdline options:

/Od /I <several includes> /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "WIN32_LEAN_AND_MEAN" /D "_WIN32_WINNT" /D "_CRT_SECURE_NO_WARNINGS" /D "BOOST_ALL_DYN_LINK" /D "CMAKE_INTDIR=\"Debug\"" /D "_WINDLL" /D "_MBCS" /FD /EHsc /RTC1 /MDd /Fo"commons.dir\Debug
" /W3 /nologo /c /Zi /TP /errorReport:prompt

Thanks for caring though!

HTH,

Stephan

comment:5 by chris_kohlhoff, 14 years ago

You need to make sure you define _WIN32_WINNT to a particular value indicating the target platform. E.g. try changing command line so it has:

/D "_WIN32_WINNT=0x501"

I have enhanced the warning message emitted by asio to make this clearer (see changeset [50945]).

comment:6 by Stephan Menzel <stephan.menzel@…>, 14 years ago

Resolution: fixed
Status: reopenedclosed

OMG, should've known.

Works, thank you very much and sorry for the trouble. To hell with windows and all those defines.

Cazart,

Stephan

comment:7 by chris_kohlhoff, 14 years ago

(In [51004]) Merged revisions 50943-50950,50961-50964,50987 via svnmerge from https://svn.boost.org/svn/boost/trunk

........

r50943 | chris_kohlhoff | 2009-02-01 22:37:18 +1100 (Sun, 01 Feb 2009) | 2 lines

Need to specify socket lib to link correctly on QNX. Fixes #2504.

........

r50944 | chris_kohlhoff | 2009-02-01 22:42:09 +1100 (Sun, 01 Feb 2009) | 2 lines

Use correct size for IP_MULTICAST_LOOP option on QNX. Fixes #2530.

........

r50945 | chris_kohlhoff | 2009-02-01 22:57:01 +1100 (Sun, 01 Feb 2009) | 2 lines

Improve warning message when _WIN32_WINNT is not correctly defined. Fixes #2541.

........

r50946 | chris_kohlhoff | 2009-02-01 23:28:12 +1100 (Sun, 01 Feb 2009) | 2 lines

Suppress unused result warning. Fixes #2534.

........

r50947 | chris_kohlhoff | 2009-02-01 23:41:01 +1100 (Sun, 01 Feb 2009) | 3 lines

Ensure arguments to windows::overlapped_ptr::complete() are passed through to the completion handler. Fixes #2614.

........

r50948 | chris_kohlhoff | 2009-02-01 23:50:08 +1100 (Sun, 01 Feb 2009) | 2 lines

Add include of <cstring> to fix a compile error on Solaris 10. Fixes #2607.

........

r50949 | chris_kohlhoff | 2009-02-02 00:25:05 +1100 (Mon, 02 Feb 2009) | 3 lines

Clear the last error following a successful Windows API call, since some socket providers may leave last error set even when the call succeeds.

........

r50950 | chris_kohlhoff | 2009-02-02 00:42:33 +1100 (Mon, 02 Feb 2009) | 2 lines

Fix errors in SSL overview and add a note about handshaking. Fixes #2617 and #2619.

........

r50961 | chris_kohlhoff | 2009-02-02 17:18:59 +1100 (Mon, 02 Feb 2009) | 2 lines

Use a pipe if eventfd is not supported at runtime. Fixes #2683.

........

r50962 | chris_kohlhoff | 2009-02-02 18:06:00 +1100 (Mon, 02 Feb 2009) | 2 lines

Add link to asio wiki.

........

r50963 | chris_kohlhoff | 2009-02-02 20:36:11 +1100 (Mon, 02 Feb 2009) | 4 lines

Use the workaround syntax for specifying a return type with boost::bind. Needed for the SSL support to work on some older compilers (in particular, g++ 3.4.5 as used with MinGW).

........

r50964 | chris_kohlhoff | 2009-02-02 20:37:10 +1100 (Mon, 02 Feb 2009) | 2 lines

Update asio version number.

........

r50987 | chris_kohlhoff | 2009-02-03 22:00:39 +1100 (Tue, 03 Feb 2009) | 2 lines

Fix generated documentation where the overloads of a function have different brief descriptions.

........

in reply to:  5 comment:8 by anonymous, 13 years ago

You need to make sure you define _WIN32_WINNT to a particular value indicating the > target platform. E.g. try changing command line so it has:

/D "_WIN32_WINNT=0x501"

Actually /D "_WIN32_WINNT=0x400" (or later) (c) MSDN

Note: See TracTickets for help on using tickets.