Get include conflicts

2 views
Skip to first unread message

jarome

unread,
Jan 10, 2012, 1:55:21 PM1/10/12
to cygwin-users
When I make my cygwin project, I keep getting

In file included from /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../
include/w32api/windows.h:98:0,
from src/tkfPusher.c:23:
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/
winsock2.h:103:2: warning: #warning "fd_set and associated macros have
been defined in sys/types. This may cause runtime problems with
W32 sockets"
mkdir -p dist/Debug-Cygwin/Cygwin_4.x-Windows

Everything works in MinGW. I added the #define __USE_W32_SOCKETS to
try and fix this because if defined, it should ignore the fd things in
types.h, but no success.

So how do I untangle the includes for Cygwin?

The code is:

#define GPC_CYGWIN
#include <stdio.h>
#include <errno.h>
#include "GPCdefs.h" // must be before sys/types
//#include <sys/types.h>
#include <dirent.h> // This includes sys/types.h
#ifdef GPC_WIN
#define __USE_W32_SOCKETS
#include <windows.h>
#include <process.h>
#include <time.h>
#ifdef GPC_CYGWIN
//#include <w32api/winsock2.h>
#include <w32api/winbase.h>
#include <string.h>
#endif
#ifdef GPC_MINGW
#include <winsock2.h>
#include <winbase.h>
#include <string.h>
#endif
#endif
Reply all
Reply to author
Forward
0 new messages