iODBC icon indicating copy to clipboard operation
iODBC copied to clipboard

Conflicting type ULONG on Cygwin x64

Open nowox opened this issue 8 years ago • 0 comments

While compiling PyODBC on Cygwin 2.1 x64 I get this issue:

In file included from /usr/include/sql.h:89:0,
                 from src/pyodbc.h:53,
                 from src/buffer.cpp:12:
/usr/include/sqltypes.h:220:24: error: conflicting declaration ‘typedef long unsigned int ULONG’
 typedef unsigned long  ULONG;
                        ^
In file included from /usr/include/w32api/combaseapi.h:153:0,
                 from /usr/include/w32api/objbase.h:14,
                 from /usr/include/w32api/ole2.h:17,
                 from /usr/include/w32api/wtypes.h:12,
                 from /usr/include/w32api/winscard.h:10,
                 from /usr/include/w32api/windows.h:97,
                 from src/pyodbc.h:50,
                 from src/buffer.cpp:12:
/usr/include/w32api/wtypesbase.h:92:15: note: previous declaration as ‘typedef unsigned int ULONG’
 typedef DWORD ULONG;
               ^
error: command 'gcc' failed with exit status 1

According to Cygwin mailing list (here, a possible solution (that eventually allow me to build pyodbc) is this one:

#ifdef __LP64__
  typedef unsigned int ULONG;
#else
  typedef unsigned long ULONG;
#endif

nowox avatar Jan 16 '17 09:01 nowox