Opened 13 years ago

Closed 13 years ago

#4019 closed defect (invalid)

Unable to compile MapServer 6.0.1 with libpng 1.5.4

Reported by: dgambin Owned by: tbonfort
Priority: high Milestone:
Component: MapServer C Library Version: 6.0
Severity: blocker Keywords:
Cc:

Description

When trying to compile MapServer 6.0.1 with libpng 1.5.4, I get:

g++ -g -fPIC -Wall -DHAVE_VSNPRINTF -DNEED_STRLCPY -DNEED_STRLCAT -DNEED_STRRSTR -DUSE_WMS_LYR -DUSE_WFS_LYR -DUSE_LIBXML2 -DUSE_CURL -DUSE_CURLOPT_PROXYAUTH -DUSE_KML -DUSE_WFS_SVR -DUSE_WMS_SVR -DUSE_MYSQL -DUSE_POSTGIS -DPOSTGIS_HAS_SERVER_VERSION -DUSE_GDAL -DUSE_OGR -DUSE_PROJ -DUSE_AGG_SVG_SYMBOLS -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 -DGD_HAS_GET_TRUE_COLOR_PIXEL -DUSE_ICONV -DUSE_GIF -DUSE_PNG -DUSE_ZLIB -DUSE_FREETYPE -DDISABLE_CVSID -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -Irenderers/agg/include -I/usr/include -I/usr/local/include -I/usr/include/postgresql -I/usr/include/mysql -DBIG_JOINS=1 -fPIC -I/usr/include -I/usr/include/libxml2 shp2img.o -L. -lmapserver -lfreetype -lz -lgd -L/usr/lib64 -lgd -ljpeg -lfreetype -lz -L/usr/local/lib -lpng -lz -lXpm -lX11 -lexpat -L/usr/lib64 -lproj -ljpeg -L/usr/local/lib -lpng -lgif -L/usr/local/lib -lgdal -L/usr/lib -lpq -L/usr/lib/mysql -lmysqlclient -lmysqlclient -lcurl -L/usr/lib -lc -lz -lxml2 -lm -lstdc++ -o shp2img ./libmapserver.a(mapimageio.o): In function `savePalettePNG': /home/dgambin/mapserver-6.0.1/mapimageio.c:274: undefined reference to `png_set_longjmp_fn' ./libmapserver.a(mapimageio.o): In function `saveAsPNG': /home/dgambin/mapserver-6.0.1/mapimageio.c:461: undefined reference to `png_set_longjmp_fn' ./libmapserver.a(mapimageio.o): In function `readPNG': /home/dgambin/mapserver-6.0.1/mapimageio.c:738: undefined reference to `png_set_longjmp_fn' collect2: ld returned 1 exit status

The same happens with MapServer 6.0.0. Here is my configure line:

./configure --with-ogr=/usr/local/bin/gdal-config --with-gdal=/usr/local/bin/gda l-config --with-wfs --with-wfsclient --with-wmsclient --enable-debug --with-curl -config=/usr/bin/curl-config --with-proj=/usr --with-jpeg --with-freetype=/usr/b in/ --with-postgis=/usr/bin/pg_config --with-mysql=/usr/bin/mysql_config --with- libiconv=/usr --with-kml=yes --with-php=/usr/include/php5 --with-png=/usr/local

Change History (2)

comment:1 by tbonfort, 13 years ago

Owner: changed from Thomas Bonfort to tbonfort

comment:2 by tbonfort, 13 years ago

Resolution: invalid
Status: newclosed

c.f. http://osgeo-org.1803224.n2.nabble.com/Problem-compiling-MapServer-6-0-1-with-libpng-td6771193.html

Problem arised because mapserver was configured to use the system GD library that links against the system libpng.

Mapserver and GD must link to the same version of libpng (and all other libraries that they share dependencies on: jpeg, gif, etc..)

Solution is either to use the system libpng for mapserver, or recompile GD to use the non-default libpng.

Note: See TracTickets for help on using tickets.