From: Boszormenyi Z. <zb...@fr...> - 2003-05-28 11:05:55
|
Benjamin Riefenstahl wrote: >Hi Zoltán, > > >Boszormenyi Zoltan <zb...@fr...> writes: > > >>I found out that I cannot get my sources that include <sql.h> to >>compile by themselves. >> >> > ><sql.h> is a Windows header. As with all Windows headers, you need to >include <windows.h> first, e.g. like > > #define WIN32_LEAN_AND_MEAN 1 > #include <windows.h> > > > >>In the search for the missing type definitions and constant defines, >>I found that I have to #include <ansidecl> (because of its "#define >>CONST const" line and <windef.h> (because of its many typedefs) >>before <sql.h>. >> >> > >With the Windows headers it never was supported to only include just >the headers that you think you need. > Thanks, you really helped me. Find my configure.in script attached that show my (ehm) misery and salvation. :-) The script does the following: 1. checks whether sql.h and sqlext.h are present. 2a. If the system is Cygwin or MinGW, these are performed: - checks whether the compiler supports -mms-bitfields (gcc-3+) - if not, checks for -fnative-struct (gcc-2.x) - according to the above, sets CFLAGS, also sets -mwindows so I don't get a console window under NT/200/XP. - checks whether compilation of sql.h needs definition of WIN32_LEAN_AND_MEAN and inclusion of windows.h. - according to this check, it tries to find SQLAllocHandle() in odbc32.dll, quits if not found. 2b. If the system is anything else, e.g. Linux, or other POSIX compatible, it checks for SQLAllocHandle() in libodbc.so, unixODBC assumed. This script helped me to compile and link my GTK2/ODBC application on Windows. I also did what this link said: http://www.cygwin.com/ml/cygwin/1999-03/msg00320.html Unfortunately the MS link for ODBC35IN.EXE is not there anymore but Google helped. ;-) Best regards and thanks for all the help! Zoltán |