[Gdal-dev] "collect2: ld returned 1 exit status" building ogrinfo

Maciej Sieczka tutey at o2.pl
Sun Jul 9 20:05:33 EDT 2006

Dnia Mon, 10 Jul 2006 00:07:00 +0200
Mateusz Loskot <mateusz at loskot.net> napisał(a):

> Maciej Sieczka wrote:

> > Today's (2006.07.09) GDAL CVS fails to build at ogrinfo.
> > 
> > Ubuntu Dapper (6.06 LTS)
> > 
> > $ geos-config --version
> > 2.2.3
> > 
> > $ g++ --version
> > g++ (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
> > 
> > ./configure --with-hdf4=/usr/local/lib --with-libz=internal
> > --with-png=internal --with-libtiff=internal --with-geotiff=internal
> > --with-jpeg=internal --with-gif=internal --with-geos=yes
> > --with-pg=/usr/bin/pg_config --with-sqlite
> > 
> > [...]
> FYI, recently, OGR has been ported to GEOS C API, so GEOS >= 2.2.0
> version is required.

I'm using 2.2.3 here, as you can read above.

> Please, try to pass complete path to geos-config in
> --with-geos=/path/to/geos-config
> instead of giving simple yes.

Done. No avail. Fails at the same stage.

> Maybe ./configure is finding old geos-config somewhere in your
> filesystem.

I don't think it is possible. I only had 2.1.4 from Dapper's
universe repo installed for a while, but I uninstalled and purged it
before building and installing 2.2.3 from source.


$ which geos-config

$ geos-config --version

> I'm building GDAL a few times a day and it works.

For a test, I purged 2.2.3 and installed Dapper's 2.1.4 back. Now GDAL
build fails too.

For "--with-geos=yes":

g++ -Wall -O2 -Iogrsf_frmts -I. -I/home/shoofi/src/straight/gdal/port
-I/home/shoofi/src/straight/gdal/ogr/ogrsf_frmts -DHAVE_GEOS=1
-I/usr/include -DOGR_ENABLED -I/home/shoofi/src/straight/gdal/port -c
ogrgeometryfactory.cpp  -fPIC -DPIC -o .libs/ogrgeometryfactory.o In
file included from ogrgeometryfactory.cpp:130: ogr_geos.h:48:22: error:
geos_c.h: No such file or directory ogrgeometryfactory.cpp: In static
member function 'static OGRGeometry*
ogrgeometryfactory.cpp:843: error: 'GEOSGeomToWKB_buf' was not declared
in this scope make[1]: *** [ogrgeometryfactory.o] Błąd 1 make[1]:
Opuszczenie katalogu `/home/shoofi/src/straight/gdal/ogr' make: ***
[ogr-target] Błąd 2

And for "--with-geos=/usr/bin/geos-config":

g++ -Wall -O2 -I/home/shoofi/src/straight/gdal/port
-I/home/shoofi/src/straight/gdal/ogr/ogrsf_frmts -I -DOGR_ENABLED
-I/home/shoofi/src/straight/gdal/port -c ogrpgdriver.cpp  -fPIC -DPIC
-o ../o/.libs/ogrpgdriver.o In file included from ogrpgdriver.cpp:48:
ogr_pg.h:126:22: error: libpq-fe.h: No such file or directory
ogr_pg.h:152: error: 'Oid' does not name a type ogr_pg.h:153: error:
expected ';' before '(' token ogr_pg.h:160: error: ISO C++ forbids
declaration of 'PGresult' with no type ogr_pg.h:160: error: expected
';' before '*' token ogr_pg.h:276: error: ISO C++ forbids declaration
of 'PGresult' with no type ogr_pg.h:276: error: expected ';' before '*'
token ogr_pg.h:283: error: 'PGresult' has not been declared
ogr_pg.h:317: error: ISO C++ forbids declaration of 'PGconn' with no
type ogr_pg.h:317: error: expected ';' before '*' token ogr_pg.h:321:
error: 'Oid' does not name a type ogr_pg.h:340: error: ISO C++ forbids
declaration of 'PGconn' with no type ogr_pg.h:340: error: expected ';'
before '*' token ogr_pg.h:342: error: expected `;' before 'int'
ogr_pg.h:367: error: 'Oid' does not name a type make[3]: ***
[../o/ogrpgdriver.o] Błąd 1 make[3]: Opuszczenie katalogu
`/home/shoofi/src/straight/gdal/ogr/ogrsf_frmts/pg' make[2]: ***
[pg-target] Błąd 2 make[2]: Opuszczenie katalogu
`/home/shoofi/src/straight/gdal/ogr/ogrsf_frmts' make[1]: *** [sublibs]
Błąd 2 make[1]: Opuszczenie katalogu
`/home/shoofi/src/straight/gdal/ogr' make: *** [ogr-target] Błąd 2

I *did* remember to "make distclean" before rebuilding, if you are
going to ask :).

Updating GDAL from CVS doesn't make any difference (there were no
changes in CVS since my problem begun).  What GEOS version are you
using? I tend to use latest stable (which is 2.2.3 now), when I'm not
following a given software development closer (while for those which I
follow more closely I prefer latest and gratest from CVS, eg. GDAL or
GRASS). What version of GEOS would you recommend for current GDAL CVS?


More information about the Gdal-dev mailing list