Boost logo

Boost :

From: Yuval Ronen (ronen_yuval_at_[hidden])
Date: 2006-12-17 14:50:09

Sebastian Redl wrote:
> Олег Абросимов 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).

Yes, and to solve it I strongly suggest that you define
WIN32_LEAN_AND_MEAN as a global define for all you translation units. It
removes most of the junk inside windows.h, including winsock.h, as far
as I remember.

Boost list run by bdawes at, gregod at, cpdaniel at, john at