Having no luck at all compiling osm2pgsql, as checked out of the SVN, on my RHEL 6 computer. I was able to run the autogen.sh script and then edited the configure script to add the “-lz” to the “ac_link=…” line. That allowed the configure script to complete successfully.
However, when running make I get this error when it tries to compile the first file in the osm2pgsql directory, build_geometry.cpp.
make[2]: Entering directory `/home/admin/Projects/osm2pgsql'
g++ -DHAVE_CONFIG_H -I. -pthread -I/usr/pgsql-9.1/include -I/usr/include/libxml2 -I/usr/include -I/usr/include -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -Igeos-fallback -g -O2 -MT build_geometry.o -MD -MP -MF .deps/build_geometry.Tpo -c -o build_geometry.o build_geometry.cpp
In file included from /usr/include/geos/geom/prep/BasicPreparedGeometry.h:27,
from /usr/include/geos/geom/prep/PreparedPolygon.h:24,
from build_geometry.cpp:37:
/usr/include/geos/geom/Coordinate.h:69: error: typedef name may not be a nested-name-specifier
/usr/include/geos/geom/Coordinate.h:69: error: expected ‘;’ before ‘<’ token
/usr/include/geos/geom/Coordinate.h:72: error: typedef name may not be a nested-name-specifier
/usr/include/geos/geom/Coordinate.h:72: error: expected ‘;’ before ‘<’ token
/usr/include/geos/geom/Coordinate.h:75: error: typedef name may not be a nested-name-specifier
/usr/include/geos/geom/Coordinate.h:75: error: expected ‘;’ before ‘<’ token
/usr/include/geos/geom/Coordinate.h:78: error: typedef name may not be a nested-name-specifier
/usr/include/geos/geom/Coordinate.h:78: error: expected ‘;’ before ‘<’ token
/usr/include/geos/geom/Coordinate.h:111: error: ‘string’ in namespace ‘std’ does not name a type
and it continues spewing errors from there.
My RHEL6 environment has gcc 4.4.6 and geos 3.3.3-1 installed. Can anyone tell me what I’m missing here?
Thanks!