Discussion:
[asio-users] Asio Compiler errors (Win7 64 Bit + VC11)
Mathias Spoerr
2012-11-11 12:28:58 UTC
Permalink
Hello,



a few days ago I upgraded from Win7 32Bit + Visual Studio 2008 to Win7 64Bit
+ Visual Studio 2012 (VC11). Now I have problems with compiling my
application. I get the following errors:

1>...\asio-1.5.3\include\asio/detail/impl/win_thread.ipp(51): error C2664:
'QueueUserAPC': cannot convert parameter 1 from 'void (__cdecl *)(ULONG)' to
'PAPCFUNC'

1>...\asio-1.5.3\include\asio/detail/impl/win_iocp_io_service.ipp(119):
error C2664: 'GetQueuedCompletionStatus': cannot convert parameter 3 from
'DWORD *' to 'PULONG_PTR'

1>...\asio-1.5.3\include\asio/detail/impl/win_iocp_io_service.ipp(349):
error C2664: 'GetQueuedCompletionStatus': cannot convert parameter 3 from
'DWORD *' to 'PULONG_PTR'



What's wrong here?



Thanks,

Mathias
Igor R
2012-11-11 13:29:00 UTC
Permalink
Post by Mathias Spoerr
a few days ago I upgraded from Win7 32Bit + Visual Studio 2008 to Win7 64Bit
+ Visual Studio 2012 (VC11). Now I have problems with compiling my
'QueueUserAPC': cannot convert parameter 1 from 'void (__cdecl *)(ULONG)' to
'PAPCFUNC'
error C2664: 'GetQueuedCompletionStatus': cannot convert parameter 3 from
'DWORD *' to 'PULONG_PTR'
error C2664: 'GetQueuedCompletionStatus': cannot convert parameter 3 from
'DWORD *' to 'PULONG_PTR'
This is because on x64 (DWORD *) is not equivalent to PULONG_PTR.
But 1.5.3 is quite outdated, so it's worth checking out the more
recent versions.
Mathias Spoerr
2012-11-11 14:11:44 UTC
Permalink
Hi Igor,
Post by Igor R
This is because on x64 (DWORD *) is not equivalent to PULONG_PTR.
But 1.5.3 is quite outdated, so it's worth checking out the more recent
versions.
thank you very much for the info. Where can I find a later version? On
sourceforge I can only find 1.5.3...
http://sourceforge.net/projects/asio/files/asio/

Regards
Mathias
Igor R
2012-11-11 14:16:30 UTC
Permalink
Post by Igor R
Post by Igor R
This is because on x64 (DWORD *) is not equivalent to PULONG_PTR.
But 1.5.3 is quite outdated, so it's worth checking out the more recent
versions.
thank you very much for the info. Where can I find a later version? On
sourceforge I can only find 1.5.3...
http://sourceforge.net/projects/asio/files/asio/
Well, actually I don't know what happens with non-boost asio.

As for Boost.Asio, it's distributed as a part of Boost package, and
you can see its revision history here:
http://www.boost.org/doc/libs/1_52_0/doc/html/boost_asio/history.html
Mathias Spoerr
2012-11-11 14:23:03 UTC
Permalink
Hi Igor,
Post by Igor R
Well, actually I don't know what happens with non-boost asio.
As for Boost.Asio, it's distributed as a part of Boost package, and you
http://www.boost.org/doc/libs/1_52_0/doc/html/boost_asio/history.html
thanks! Since I use Boost for many other things I will switch to Boost Asio.

Regards,
Mathias
Mathias Spoerr
2012-11-11 14:47:39 UTC
Permalink
Hi again,

I still see the same compiler errors with Boost 1.52:
1>...\boost\boost_1_52_0\boost/asio/detail/impl/win_thread.ipp(52): error
C2664: 'QueueUserAPC': Konvertierung des Parameters 1 von 'void (__cdecl
*)(ULONG)' in 'PAPCFUNC' nicht möglich
1>...\boost\boost_1_52_0\boost/asio/detail/impl/win_iocp_io_service.ipp(118)
: error C2664: 'GetQueuedCompletionStatus': Konvertierung des Parameters 3
von 'boost::asio::detail::win_iocp_io_service::dword_ptr_t *' in
'PULONG_PTR' nicht möglich
1>...\boost\boost_1_52_0\boost/asio/detail/impl/win_iocp_io_service.ipp(359)
: error C2664: 'GetQueuedCompletionStatus': Konvertierung des Parameters 3
von 'boost::asio::detail::win_iocp_io_service::dword_ptr_t *' in
'PULONG_PTR' nicht möglich

Thanks,
Mathias
Gruenke, Matt
2012-11-11 18:50:31 UTC
Permalink
I'd look around to see what other boost libraries do. I'm sure boost must already have some portability utils to deal with this sort of thing. Maybe ask on the boost dev mailing list, but definitely file a bug in the boost bug tracker.


Matt

________________________________

From: Mathias Spoerr [mailto:***@spoerr.org]
Sent: Sun 11/11/2012 9:47 AM
To: asio-***@lists.sourceforge.net
Subject: Re: [asio-users] Asio Compiler errors (Win7 64 Bit + VC11)



Hi again,

I still see the same compiler errors with Boost 1.52:
1>...\boost\boost_1_52_0\boost/asio/detail/impl/win_thread.ipp(52): error
C2664: 'QueueUserAPC': Konvertierung des Parameters 1 von 'void (__cdecl
*)(ULONG)' in 'PAPCFUNC' nicht möglich
1>...\boost\boost_1_52_0\boost/asio/detail/impl/win_iocp_io_service.ipp(118)
: error C2664: 'GetQueuedCompletionStatus': Konvertierung des Parameters 3
von 'boost::asio::detail::win_iocp_io_service::dword_ptr_t *' in
'PULONG_PTR' nicht möglich
1>...\boost\boost_1_52_0\boost/asio/detail/impl/win_iocp_io_service.ipp(359)
: error C2664: 'GetQueuedCompletionStatus': Konvertierung des Parameters 3
von 'boost::asio::detail::win_iocp_io_service::dword_ptr_t *' in
'PULONG_PTR' nicht möglich

Thanks,
Mathias


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
asio-users mailing list
asio-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/asio-users
_______________________________________________
Using Asio? List your project at
http://think-async.com/Asio/WhoIsUsingAsio
Mathias Spoerr
2012-11-11 19:01:15 UTC
Permalink
Hi Matt,

thank you for the answer, but I only get these errors for Asio – all used
boost libs compile successfully. And I had the same issue with the
stand-alone Asio version.



Thanks,

Mathias





Von: Gruenke, Matt [mailto:***@Tycoint.com]
Gesendet: Sonntag, 11. November 2012 19:51
An: asio-***@lists.sourceforge.net
Betreff: Re: [asio-users] Asio Compiler errors (Win7 64 Bit + VC11)



I'd look around to see what other boost libraries do. I'm sure boost must
already have some portability utils to deal with this sort of thing. Maybe
ask on the boost dev mailing list, but definitely file a bug in the boost
bug tracker.





Matt



_____

From: Mathias Spoerr [ <mailto:***@spoerr.org>
mailto:***@spoerr.org]
Sent: Sun 11/11/2012 9:47 AM
To: <mailto:asio-***@lists.sourceforge.net>
asio-***@lists.sourceforge.net
Subject: Re: [asio-users] Asio Compiler errors (Win7 64 Bit + VC11)

Hi again,

I still see the same compiler errors with Boost 1.52:
1>...\boost\boost_1_52_0\boost/asio/detail/impl/win_thread.ipp(52): error
C2664: 'QueueUserAPC': Konvertierung des Parameters 1 von 'void (__cdecl
*)(ULONG)' in 'PAPCFUNC' nicht möglich
1>...\boost\boost_1_52_0\boost/asio/detail/impl/win_iocp_io_service.ipp(118)
: error C2664: 'GetQueuedCompletionStatus': Konvertierung des Parameters 3
von 'boost::asio::detail::win_iocp_io_service::dword_ptr_t *' in
'PULONG_PTR' nicht möglich
1>...\boost\boost_1_52_0\boost/asio/detail/impl/win_iocp_io_service.ipp(359)
: error C2664: 'GetQueuedCompletionStatus': Konvertierung des Parameters 3
von 'boost::asio::detail::win_iocp_io_service::dword_ptr_t *' in
'PULONG_PTR' nicht möglich

Thanks,
Mathias


----------------------------------------------------------------------------
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
<http://p.sf.net/sfu/appdyn_d2d_nov> http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
asio-users mailing list
<mailto:asio-***@lists.sourceforge.net> asio-***@lists.sourceforge.net
<https://lists.sourceforge.net/lists/listinfo/asio-users>
https://lists.sourceforge.net/lists/listinfo/asio-users
_______________________________________________
Using Asio? List your project at
http://think-async.com/Asio/WhoIsUsingAsio
Igor R
2012-11-11 19:49:20 UTC
Permalink
Post by Mathias Spoerr
1>...\boost\boost_1_52_0\boost/asio/detail/impl/win_thread.ipp(52): error
C2664: 'QueueUserAPC': Konvertierung des Parameters 1 von 'void (__cdecl
*)(ULONG)' in 'PAPCFUNC' nicht möglich
1>...\boost\boost_1_52_0\boost/asio/detail/impl/win_iocp_io_service.ipp(118)
: error C2664: 'GetQueuedCompletionStatus': Konvertierung des Parameters 3
von 'boost::asio::detail::win_iocp_io_service::dword_ptr_t *' in
'PULONG_PTR' nicht möglich
1>...\boost\boost_1_52_0\boost/asio/detail/impl/win_iocp_io_service.ipp(359)
: error C2664: 'GetQueuedCompletionStatus': Konvertierung des Parameters 3
von 'boost::asio::detail::win_iocp_io_service::dword_ptr_t *' in
'PULONG_PTR' nicht möglich
As far as I see, dword_ptr_t is defined as follows:
#if defined(WINVER) && (WINVER < 0x0500)
typedef DWORD dword_ptr_t;
typedef ULONG ulong_ptr_t;
#else
typedef DWORD_PTR dword_ptr_t;
typedef ULONG_PTR ulong_ptr_t;
#endif

So, it seems that in WINVER is not defined correctly in your project.
Define it globally as 0x0501.
Mathias Spoerr
2012-11-11 20:10:51 UTC
Permalink
Hi Igor,

thank you very much for the hint! With this setting it is working.
It was working before because of the "#define _WIN32_WINNT 0x0501" statement.

Why is WINVER not set by system (Visual Studio)? I am sorry for this question...

Regards,
Mathias


-----Ursprüngliche Nachricht-----
Von: Igor R [mailto:***@gmail.com]
Gesendet: Sonntag, 11. November 2012 20:49
An: asio-***@lists.sourceforge.net
Betreff: Re: [asio-users] Asio Compiler errors (Win7 64 Bit + VC11)
1>error
C2664: 'QueueUserAPC': Konvertierung des Parameters 1 von 'void
(__cdecl *)(ULONG)' in 'PAPCFUNC' nicht möglich
1>...\boost\boost_1_52_0\boost/asio/detail/impl/win_iocp_io_service.ip
1>p(118)
: error C2664: 'GetQueuedCompletionStatus': Konvertierung des
Parameters 3 von
'boost::asio::detail::win_iocp_io_service::dword_ptr_t *' in
'PULONG_PTR' nicht möglich
1>...\boost\boost_1_52_0\boost/asio/detail/impl/win_iocp_io_service.ip
1>p(359)
: error C2664: 'GetQueuedCompletionStatus': Konvertierung des
Parameters 3 von
'boost::asio::detail::win_iocp_io_service::dword_ptr_t *' in
'PULONG_PTR' nicht möglich
As far as I see, dword_ptr_t is defined as follows:
#if defined(WINVER) && (WINVER < 0x0500)
typedef DWORD dword_ptr_t;
typedef ULONG ulong_ptr_t;
#else
typedef DWORD_PTR dword_ptr_t;
typedef ULONG_PTR ulong_ptr_t;
#endif

So, it seems that in WINVER is not defined correctly in your project.
Define it globally as 0x0501.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
asio-users mailing list
asio-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/asio-users
_______________________________________________
Using Asio? List your project at
http://think-async.com/Asio/WhoIsUsingAsio
Igor R
2012-11-11 20:46:06 UTC
Permalink
Post by Mathias Spoerr
thank you very much for the hint! With this setting it is working.
It was working before because of the "#define _WIN32_WINNT 0x0501" statement.
Why is WINVER not set by system (Visual Studio)? I am sorry for this question...
VS doesn't define this macro, because it can't know what OS you want
to target. It's defined either by Windows SDK headers or by your
application headers.
http://msdn.microsoft.com/en-us/library/6sehtctf(v=vs.100).aspx

Loading...