[Mapserver-users] trouble compiling mapserver with ogr

Frank Warmerdam warmerdam at pobox.com
Wed Apr 28 12:14:49 EDT 2004


Moritz Lennert wrote:
> All of them resulting in the same compile error:
> 
> gcc -O2  -Wall -DIGNORE_MISSING_DATA  -DUSE_EPPL -DUSE_PROJ
> -DUSE_PROJ_API_H -DUSE_WMS_SVR       -DUSE_JPEG -DUSE_GD_PNG -DUSE_GD_JPEG
> -DUSE_GD_WBMP -DUSE_GD_FT -DUSE_PDF  -DUSE_OGR -DUSE_GDAL -DUSE_POSTGIS   
> -I/usr//include         -I/usr/include -I/usr/include
> -I/usr/include/postgresql     shp2img.o  -L. -lmap -L/usr//lib -lgd -ljpeg
> -lfreetype -lpng -lz   -lpdf -ljpeg -lfreetype -lpng -lz   -lproj -ljpeg 
> -L/usr/lib -lgdal   -L/usr/lib -lpq      -lm -lstdc++   -o shp2img
> ./libmap.a(mapogr.o)(.text+0x15b): dans la fonction «
> ogrGeomPoints(OGRGeometry*, shapeObj*)    »:
> : undefined reference to `OGRGeometryCollection::getNumGeometries()'
> ./libmap.a(mapogr.o)(.text+0x2b7): dans la fonction «
> ogrGeomPoints(OGRGeometry*, shapeObj*)    »:

Hi,

Is there any possibility that the OGR on your system was built with a
difference version of gcc than you are using for MapServer?  C++ linkage
naming conventions in object code have varied somewhat between versions of
gcc, so if you are using a different gcc than was used to build GDAL/OGR, then
you might get surprising issues like the above.  This is especially common if
you got the GDAL/OGR from some other source (ie. RPMs or .deb's from elsewhere).

If this is the issue, then I would suggest you build and install GDAL/OGR
from source on your system.

Note, at some point I would like to move mapogr.cpp to using the OGR C API
specifically to avoid the overly intimate relationship between MapServer and
OGR.  This should make it much easier to mix and match in the future.

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 mapserver-users mailing list