[Mapserver-users] mapserver compile problems

Daniel Morissette morissette at dmsolutions.ca
Tue Jan 7 16:43:54 EST 2003


Philipp Jacob wrote:
> 
> the configure command:
> "CXX=/opt/gcc295/bin/c++ CC=/opt/gcc295/bin/gcc ./configure --with-gd
> --with-php=../php-4.2.3/ --with-gdal=../gdal-1.1.7/
> --enable-force-freetype1 --with-proj --with-wmsclient"
> 
...

> but when i do 'make' the make process stops with the following error:
> 
> ----------
> [...some regular make outout above this...]
> /opt/gcc295/bin/gcc -O2  -Wall -DIGNORE_MISSING_DATA  -DUSE_EPPL
> -DUSE_PROJ -DUSE_WMS -DUSE_WMS_LYR  -DUSE_TIFF -DUSE_JPEG -DUSE_GD_PNG
> -DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT    -DUSE_GDAL
> -I/usr/local/include            -I/usr/local/include
> -I/usr/local/include/w3c-libwww -DHAVE_CONFIG_H  shp2img.o  -L. -lmap
> -lgd -L/usr/local/lib -lgd -ljpeg -lttf -lpng -lz  -ltiff -ljpeg -lttf
> -lpng -lz -lproj -ljpeg      -L/usr/local/lib -lwwwxml -lxmltok
> -lxmlparse -lwwwinit -lwwwapp -lwwwhtml -lwwwtelnet -lwwwnews -lwwwhttp
> -lwwwmime -lwwwgopher -lwwwftp -lwwwfile -lwwwdir -lwwwcache -lwwwstream
> -lwwwmux -lwwwtrans -lwwwcore -lwwwutils -lmd5 -ldl    -lm   -o shp2img
> ./libmap.a(mapraster.o): In function `drawGDAL':
> mapraster.o(.text+0x4d4): undefined reference to `GDALGetRasterXSize'
> ...

You are getting this because configure didn't find the 'gdal-config'
script and it failed to include -lgdal.1.1 in the link arguments.  You
have to pass the full path to the gdal-config file in the --with-gdal
parameter, not just the path to GDAL (I know this can become confusing).

The configure script should have complained about this but it didn't, so
I fixed it in both 3.6.4-dev and 3.7-dev to complain about this
mistake.  The './configure --help' output also documented the option as 
'--with-gdal[=DIR]' and I changed it to '--with-gdal[=PATH]' which will
hopefully reduce the chances of confusion.

Now, you should be able to compile without getting those fixes as long
as you pass the right argument to --with-gdal:

Did you 'make install' in the GDAL directory?  That would be the best
thing to do and then you could use '--with-gdal' without any argument
assuming that /usr/local/bin/gdal-config is in your path.

If you must specify an alternate location for GDAL then you should pass
the full path and filename of the gdal-config script, if you didn't
'make install' GDAL, then the path should likely be:
  --with-gdal=../gdal-1.1.7/apps/gdal-config

Daniel
-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------




More information about the mapserver-users mailing list