[Gdal-dev] Compile Error

Frank Warmerdam warmerdam at pobox.com
Tue Oct 14 10:13:27 EDT 2003


Paul Kelly wrote:

> See below for make output from today's CVS on an SGI IRIX 6.2 system
> (1.1.9 compiles fine as far as I can remember). Seems to me here it is
> trying to use the C compiler to compile a C++ source file. Same thing
> happens both with and without using libtool.
...
> make[2]: Entering directory `/indigo-disk2/grass/gdal-libtool/frmts/gxf'
> /bin/sh ../../libtool --mode=compile cc -I../../port -I../../gcore -I../../ogr    -c -o ../o/gxfdataset.o gxfdataset.cpp
>  cc -I../../port -I../../gcore -I../../ogr -c gxfdataset.cpp  -DPIC -o ../o/.libs/gxfdataset.o
> cfe: Error: ../../gcore/gdal_priv.h, line 176: Syntax Error
>  class GDALMajorObject;
>  ------^

Paul,

That is pretty funky.  I tried building on Linux and get this:

warmerda at gdal[122]% make
/bin/sh ../../libtool --mode=compile g++ -Wall  -g -DDEBUG  -I../../port -I../.
/gcore -I../../ogr  -c -o gxfdataset.o gxfdataset.cpp
  g++ -Wall -g -DDEBUG -I../../port -I../../gcore -I../../ogr -c gxfdataset.cpp
-fPIC -DPIC -o .libs/gxfdataset.o
  g++ -Wall -g -DDEBUG -I../../port -I../../gcore -I../../ogr -c gxfdataset.cpp
o gxfdataset.o >/dev/null 2>&1
/bin/sh ../../libtool --mode=compile gcc -Wall  -g -DDEBUG   -I../../port -I../
./gcore -I../../ogr  -c -o gxfopen.o gxfopen.c
  gcc -Wall -g -DDEBUG -I../../port -I../../gcore -I../../ogr -c gxfopen.c  -fPI
  -DPIC -o .libs/gxfopen.o

In short, the makefile seems to know to use the configured C++ compiler for
gxfdataset.cpp and the configured C compiler for the remaining .c files.   What
are the CXX and CC macros set to in your GDALmake.opt?  I am assuming that since
you got as far as GXF that the C++ compiler must be setup properly though if
not you could definately see this behaviour.  If that is the case you could
either hand edit your GDALmake.opt or rerun configure with "CXX=CC" in
your environment or something similar.

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