[Gdal-dev] Compliation error with 1.2.0 on Linux

Frank Warmerdam warmerdam at pobox.com
Mon Mar 15 03:30:24 EST 2004


Susumu TANIMURA wrote:
> Hi Frank,
> 
> Thank you for reply. 
> 
> 
>>It would appear you have an older gdal.h in /usr/local/include and
>>that is being used in preference to the copy in the ../gcore.  Hmm,
>>when I build the include path looks like " -I../port -I../gcore
>>-I../ogr -I../port".  I wonder how all that extra stuff about
>>-I/usr/include and so forth got in there.  Anything special about
>>how you configured?
> 
> 
> There is gdal.h v 1.70 in /usr/include and gdal.h v 1.77 in
> /home/hoge/rpm/BUILD/gdal-1.2.0/gcore/ in which I tried build rpm
> package of gdal 1.2.0.
> 
> Here are my configure options in log message.
> 
> + ./configure i386-vine-linux --prefix=/usr --exec-prefix=/usr
> --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
> --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib
> --libexecdir=/usr/libexec --localstatedir=/var/lib
> --sharedstatedir=/usr/share --mandir=/usr/share/man
> --infodir=/usr/info --with-libz=/usr/include --with-png=/usr/include
> --with-gif=/usr/include --with-geotiff=internal
> --with-jpeg=/usr/include --with-libtiff=internal
> --with--pymodir=/usr/lib/python2.1/site-packages

Hi,

A few notes:

Directives like --with-jpeg, --with-gif, and --with-png should
be pointing to the whole tree, not just the include files.  So a
more appropriate form would be --with-gif=/usr.  And since this is
in the default path, it is likely sufficient to build with --with-gif
with no argument.

You are geting lots of "-I/usr/include/include" because of the wrong
arguments to the various --with options.

Also, you should use "--with-pymoddir", not "--with--pymodir".

> The versions of external libraries are followed.
> $ rpm -q lib{png,tiff,ungif,jpeg}-devel zlib-devel
> libpng-devel-1.0.12-0vl3
> libtiff-devel-3.5.7-6vl1
> libungif-devel-4.1.0-9vl1
> libjpeg-devel-6b-15vl1
> zlib-devel-1.1.4-0vl2
...

 > Thank Frank, I got pass the compile error with removing
 > /usr/include/gdal.h, but still I could not complete the compilation.
 >
 > Another error was given as followed.
 >
 > g++ -Wall -O2 -m486 -fno-strength-reduce -I/usr/include -I/usr/include/include -I/usr/include -I/usr/include/include 
-I/usr/include -I/usr/include/include -I../../port -I../../gcore -I../../ogr -Ilibgeotiff -Ilibtiff -I../../port -c 
geotiff.cpp  -fP IC -DPIC -DPIC -o ../o/geotiff.o
 > geotiff.cpp: In function `struct TIFF * GTiffCreate(const char *, int, int, int, GDALDataType, char **)':
 > geotiff.cpp:2732: `PHOTOMETRIC_ICCLAB' undeclared (first use this function)
 > geotiff.cpp:2732: (Each undeclared identifier is reported only once
 > geotiff.cpp:2732: for each function it appears in.)
 > geotiff.cpp: In function `void GTiffTagExtender(TIFF *)':
 > geotiff.cpp:3609: ANSI C++ forbids declaration `TIFFFieldInfo' with no type
 > geotiff.cpp:3609: uninitialized const `TIFFFieldInfo'
 > geotiff.cpp:3609: parse error before `['
 > geotiff.cpp:3609: warning: unused variable `const int TIFFFieldInfo'
 > geotiff.cpp: At top level:
 > geotiff.cpp:3619: `tif' was not declared in this scope
 > geotiff.cpp:3619: `xtiffFieldInfo' was not declared in this scope
 > geotiff.cpp:3620: `xtiffFieldInfo' was not declared in this scope
 > geotiff.cpp:3620: `xtiffFieldInfo' was not declared in this scope
 > geotiff.cpp:3620: ANSI C++ forbids declaration `TIFFMergeFieldInfo' with no typegeotiff.cpp:3620: initializer list 
being treated as compound expression
 > geotiff.cpp:3621: parse error before `}'
 > make[2]: *** [../o/geotiff.o] Error 1
 > make[2]: Leaving directory `/home/hoge/rpm/BUILD/gdal-1.2.0/frmts/gtiff'
 > make[1]: *** [gtiff-install-obj] Error 2
 > make[1]: Leaving directory `/home/hoge/rpm/BUILD/gdal-1.2.0/frmts'
 > make: *** [frmts-target] Error 2
 > Bad exit status from /var/tmp/rpm-tmp.35260 (%build)

The problem, once again is that you are getting the wrong include
files. In this case you are getting your global libtiff include files
instead of the ones contained within the GDAL distribution.  GDAL depends
on at least libtiff 3.6.0 or newer. I see you have (appropriately)
configured with the internal libtiff but the -I/usr/include is getting
inserted because of your many configure options pointing to that area.

In theory, when we want to reference local directories we should be
ensuring those includes take preference over global includes.  I am
a bit surprised that isn't happening.  If you wouldn't mind filing a bug
with the configure, and compile information I would appreciate it.  In
particular the compile line should list "-Ilibtiff" ahead of all the
-I/usr/include type stuff.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list