On Tue, Mar 20, 2012 at 11:16 PM, Ruben Van Boxem
<[email protected]> wrote:
> 2012/3/20 Earnie Boyd <[email protected]>
>>
>> On Tue, Mar 20, 2012 at 1:50 PM, Vincent Torri <[email protected]>
>> wrote:
>> > Hey
>> >
>> > with latest d-bus release (1.4.18) :
>> >
>> > In file included from dbus-sockets-win.h:36:0,
>> >                 from dbus-sysdeps-win.c:49:
>> >
>> > c:\mingw_efl\mingw-w64-x86_32\bin\../lib/gcc/i686-w64-mingw32/4.6.2/../../../../i686-w64-mingw32/include/winsock2.h:15:2
>> > : warning: #warning Please include winsock2.h before windows.h [-Wcpp]
>> >
>>
>> I wonder why it matters?  The mingw.org version of winsock2.h just
>> includes windows.h as the first item of business.  Let's ask
>> mingw-64-public?
>
>
> This will cause problems with the fact that windows.h includes winsock.h
> (check MSVC headers, you'll find it). Including winsock2.h after winsock.h
> (through windows.h for example) will produce double definition errors.
>

For that reason if winsock2 api is preferred one needs to do
#include <winsock2.h>
#include <windows.h>
... which is the righnt way of doing it

alternatively, one can also do
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#include <winsock2.h>

> For reference, see the "note" here:
> http://msdn.microsoft.com/en-us/library/ms737629%28VS.85%29.aspx
> 'Historical reasons'

Yup

--
O.S.

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to