Opened 19 years ago

Last modified 19 years ago

#847 closed defect (fixed)

Compile syntax error in .ogr_srs_api.h

Reported by: rob@… Owned by: warmerdam
Priority: high Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

gdal version: cvs 6 may 2005
system:  FreeBSD 4.10-RELEASE-p3 #2

I get this error while compiling gdal:

. . .
 g++ -Wall -O2 -I.. -I../.. -I/usr/local/include -I../../../port -I/usr/local
-I/usr/local/include -I/usr/local -I/usr/local/include -c ogrpgdriver.cpp  -fPIC
-DPIC -o ../o/.libs/ogrpgdriver.o
In file included from ../../ogr_spatialref.h:99,
                 from ../../ogr_geometry.h:201,
                 from ../../ogr_feature.h:125,
                 from ../ogrsf_frmts.h:187,
                 from ogr_pg.h:88,
                 from ogrpgdriver.cpp:45:
../../ogr_srs_api.h:376: syntax error before `('
../../ogr_srs_api.h:377: syntax error before `('
../../ogr_srs_api.h:378: syntax error before `('
../../ogr_srs_api.h:379: syntax error before `('
../../ogr_srs_api.h:389: syntax error before `('
../../ogr_srs_api.h:400: syntax error before `('
../../ogr_srs_api.h:401: syntax error before `('
../../ogr_srs_api.h:402: syntax error before `('
../../ogr_srs_api.h:412: syntax error before `('
../../ogr_srs_api.h:415: syntax error before `('
../../ogr_srs_api.h:435: syntax error before `('
../../ogr_srs_api.h:670: syntax error before `('
../../ogr_srs_api.h:673: syntax error before `('
../../ogr_srs_api.h:676: syntax error before `('
../../ogr_srs_api.h:680: syntax error before `('
gmake[3]: *** [../o/ogrpgdriver.o] Error 1
gmake[3]: Leaving directory `/data2/local/installs/gdal/ogr/ogrsf_frmts/pg'
gmake[2]: *** [pg-target] Error 2
gmake[2]: Leaving directory `/data2/local/installs/gdal/ogr/ogrsf_frmts'
gmake[1]: *** [sublibs] Error 2
gmake[1]: Leaving directory `/data2/local/installs/gdal/ogr'
gmake: *** [ogr-target] Error 2

Configure command:

./configure \
    --prefix=/usr/local \
    --with-png=/usr/local \
    --with-libtiff=internal \
    --with-geotiff=internal \
    --with-jpeg=/usr/local \
    --without-libgrass \
    --with-mysql=/usr/local/bin/mysql_config \
    --with-pg=/usr/local/bin/pg_config

Change History (2)

comment:1 by warmerdam, 19 years ago

Rob, 

I believe the problem is that an old cpl_config.h or cpl_port.h from 
/usr/local/include is getting picked up in stead of the one from the port
directory. 

I have committed a change to the GNUmakefile in CVS to ensure that all local
GDAL includes appear ahead of the PG includes which appear ahead of the generic
includes. 

CPPFLAGS	:=	$(GDAL_INCLUDE) $(PG_INC) $(CPPFLAGS)

This should fix your case if you update the appropriate line in 
gdal/ogr/ogrsf_frmts/pg/GNUmakefile.


comment:2 by warmerdam, 19 years ago

*** Bug 848 has been marked as a duplicate of this bug. ***
Note: See TracTickets for help on using tickets.