[unixODBC-dev] Error when building GDAL against unixODBC

Normand Savard nsavard at mapgears.com
Mon Jan 12 13:38:22 GMT 2009


I tried to compile GDAL 1.6.0 against unixODBC 2.2.14 and the following 
errors appears:

sqltypes.h:400: error: ISO C++ forbids declaration of ‘SQLBIGINT’ with 
no type
sqltypes.h:403: error: ISO C++ forbids declaration of ‘SQLUBIGINT’ with 
no type


This error happens because ODBCINT64 is defined to a none value within
unixodbc_conf.h. The relevant lines of code in sqltypes.h are:

#ifdef ODBCINT64
typedef ODBCINT64 SQLBIGINT;
#endif
#ifdef UODBCINT64
typedef UODBCINT64 SQLUBIGINT;
#endif

The code in unixodbc_conf.h is:

#ifndef ODBCINT64
#define ODBCINT64
#endif
#ifndef UODBCINT64
#define UODBCINT64
#endif

The compilation switches are:
?g++ -g -O2 -fPIC -Wall -DOGR_ENABLED 
-I/home/fgs/fgs-dev/src/gdal-1.6.0/port
-I/home/fgs/fgs-dev/built/unixODBC 
-I/home/fgs/fgs-dev/built/unixODBC/include
-I/home/fgs/fgs-dev/built/jpeg -I/home/fgs/fgs-dev/built/jpeg/include
-I/home/fgs/fgs-dev/built/libgeotiff/include 
-I/home/fgs/fgs-dev/built/tiff/include
-I/home/fgs/fgs-dev/built/libpng -I/home/fgs/fgs-dev/built/libpng/include
-I/home/fgs/fgs-dev/built/curl/include -I../frmts/zlib -DHAVE_CURL 
-DHAVE_LIBZ
-c -o cpl_odbc.o cpl_odbc.cpp

I built unixODBC without a problem. I'm sure that there are good reasons to
define these constants within unixodbc_conf.h. Nevertheless do you have 
a suggestion
to solve this issue?

Norm


More information about the unixODBC-dev mailing list