Boost logo

Boost :

From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2006-06-26 01:30:36


Hi Felipe,

Felipe Magno de Almeida <felipe.m.almeida_at_[hidden]> wrote:
> The VC7.1 complains that win_iocp_operation cant be converted
> to WSAOVERLAPPED when tried to pass it to WSASend.
> I inserted this on win_iocp_socket_service.hpp:526
>
> - &bytes_transferred, flags, ptr.get(), 0);
> +&bytes_transferred, flags,
> reinterpret_cast<LPWSAOVERLAPPED>(static_cast<LPOVERLAPPED>(ptr.get())),
> 0);
>
> And it worked here.

Actually the problem is a missing define for WIN32. Newer
Platform SDKs (like the one I use) automatically #define WIN32
for you in WinDef.h, but the one shipped with VC7.1 does not. If
WIN32 is not defined, Winsock2.h assumes you are compiling for
16-bit Windows (!) and redefines the WSAOVERLAPPED structure
instead of just making it a typedef for OVERLAPPED.

You can work around the problem by adding the WIN32 definition
to your makefile/Jamfile/project settings. I have made a change
to asio/detail/socket_types.hpp in asio's CVS repository to
automatically define it, and will merge the change over to Boost
CVS soon.

Cheers,
Chris


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk