Boost logo

Boost :

From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2006-12-17 12:05:48


Олег Абросимов wrote:
> I've used review version of asio and found that if I include <windows.h> header before any asio headers then there are >100 errors arised with symbols redifinition. If it is included after asio headers - it compiles perfectly.
> Is this problem resolved in current CVS?
>
This is a problem inherent with <windows.h> in that it includes
<winsock.h> if <winsock2.h> has not already been included. ASIO relies
on Winsock2 functions, so it needs to include <winsock2.h> before
<windows.h>. <winsock2.h> is incompatible with <winsock.h> - once one is
included, including the other would lead to errors (but actually, they
block on each other's header guards).

Since anything that happens before including ASIO headers is out of
ASIO's control, I don't think it is even possible for ASIO to solve this
problem. The problem is in the broken design (or rather evolution) of
the WinAPI includes.

Sebastian Redl


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