Problems compiling Mapserver 5.0.0
William Hudspeth
bhudspeth at EDAC.UNM.EDU
Wed Dec 5 08:56:16 PST 2007
William Hudspeth wrote:
> Hello,
>
> I am trying to install Mapserver 5.0.0 on a machine running Suse Linux
> 10.1. I have used the following configure statement with no errors:
>
> ./configure --with-freetype=/usr/bin/freetype-config
> --with-zlib=/usr/local/zlib --with-png=/usr/local/png
> --with-jpeg=/usr/local/jpeg --with-gd=/usr/local
> --with-proj=/usr/local/proj
--with-geos=/usr/local/geos/bin/geos-config
> --with-ogr=/usr/bin/gdal-config --with-gdal=/usr/bin/gdal-config
> --with-postgis=/usr/local/pgsql/bin/pg-config --with-wfs --with-wcs
> --with-wmsclient --with-wfsclient
> --with-curl-config=/usr/bin/curl-config --with-httpd=/usr/sbin/httpd2
> --with-php=/usr/include/php5
>
> When I try to run make, I get the following errors (I have only
included
> the last few lines of the output):
>
> mappostgis.c:1647: error: ‘PGresult’ undeclared (first use in this
> function)
William,
I'd suggest you look closely at what gets set for the following lines in
your Makefile:
# Optional PostGIS Support. See http://postgis.refractions.net/
POSTGIS= -DUSE_POSTGIS
POSTGIS_LIB= -L/usr/lib/postgresql/8.0/lib -lpq
POSTGIS_INC= -I/usr/include/postgresql
Also, the most important thing to see is the compile line for mappostgis
and the first few errors. I'd like to confirm that -DUSE_POSTGIS is on
the compile line, and see if any include files are reporting as not
found.
I am guessing that pg-config is not returning appropriate configuration
information for your setup, and that this is causing libpq-fe.h to not
be
found.
Best regards,
------------------------------------------------------------------
Frank,
Thanks for responding. You were right about pg-config not returning
appropriate configuration information. I made the changes to the
Makefile, pointing to the existing /lib and /include directories for my
installation of postgresql (e.g. /usr/local/pgsql). When I run make
again, it gets a little further along, and then throws the following
errors:
g++ -O2 -fPIC -Wall -DNEED_NONBLOCKING_STDERR -DHAVE_VSNPRINTF
-DNEED_STRLCAT -DUSE_EPPL -DUSE_PROJ -DUSE_WMS_SVR -DUSE_WMS_LYR
-DUSE_WFS_SVR -DUSE_WFS_LYR -DUSE_WCS_SVR -DUSE_GD_GIF -DUSE_GD_PNG
-DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT -DGD_HAS_FTEX_XSHOW
-DGD_HAS_GDIMAGEGIFPTR -DGD_HAS_GETBITMAPFONTS -DUSE_OGR -DUSE_GDAL
-DUSE_GEOS -DUSE_ICONV -DUSE_POSTGIS -DUSE_ZLIB
-I/usr/local/include -I/usr/local/proj/include
-I/usr/src/packages/BUILD/gdal-root//usr/include
-I/usr/local/pgsql/include -I/usr/local/geos/include shp2img.o
-L. -lmapserver -L/usr/local/lib -lgd -ljpeg -lfreetype
-L/usr/local/png/lib -lpng -lz -ljpeg -lfreetype
-L/usr/local/png/lib -lpng -lz -L/usr/local/proj/lib -lproj -ljpeg
-L/usr/src/packages/BUILD/gdal-root//usr/lib -lgdal -L/usr/lib -lgeos
-lpq -L/usr/lib -lpq -lz -lm -lrt -ldl -lsqlite3 -L/usr/local/pgsql/lib
-lpq -L/usr/lib -lcurl -lidn -lssl -lcrypto -ldl -lz
-L/usr/local/geos/lib -lgeos_c -lc -lz -lm -lstdc++ -o shp2img
./libmapserver.a(mapgeos.o): In function `msGEOSLength':
mapgeos.c:(.text+0xf22): undefined reference to `GEOSLength'
./libmapserver.a(mapgeos.o): In function `msGEOSArea':
mapgeos.c:(.text+0xf92): undefined reference to `GEOSArea'
collect2: ld returned 1 exit status
make: *** [shp2img] Error 1
The Makefile reference to GEOS is:
# Optional GEOS Support.
# See http://geos.refractions.net/
GEOS= -DUSE_GEOS
GEOS_LIB= -L/usr/local/geos/lib -lgeos_c
GEOS_INC= -I/usr/local/geos/include
Thank you, W
More information about the MapServer-users
mailing list