[mapserver-users] Build error mapserver in shp2img - undefined reference

Peter Maes thxftw at gmail.com
Thu May 10 05:58:03 EDT 2012


Hi,

Thanks for getting back to me so quickly. I actually started off like that.
This build config:
./configure \
        --prefix=/data/installed/mapserver \
        --with-threads \
        --with-fastcgi  \
        --with-freetype=/usr/bin/freetype-config   \
        --with-zlib \
        --with-libiconv=/data/installed/libiconv \
        --with-gd \
        --with-ogr \
        --with-geos=/usr/bin/geos-config \
        --with-gdal \
        --with-png \
        --with-proj=/usr/ \
        --with-curl-config=/usr/bin/curl-config \
        --with-wfs \

Results in :

MapServer Version from mapserver.h: '6.0.2'
checking if pkg-config path is provided... checking for pkg-config...
/usr/bin/pkg-config
checking for Freetype2.x in /usr/bin/freetype-config... checking for
FT_Init_FreeType in -lfreetype... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking ft2build.h usability... yes
checking ft2build.h presence... yes
checking for ft2build.h... yes
configure: checking where Zlib is installed...
checking for zlibVersion in -lz... yes
        using libz from system libs (-DUSE_ZLIB).
configure: checking where PNG is installed...
configure: error: cannot find png lib in
/data/sources/mapserver/mapserver-6.0.2/yes

I also tried with png in /usr, but that didnt work either.

These png libs are installed:

i   libpng12-0
                                   - PNG library - runtime
i   libpng12-dev
                                   - PNG library - development

This brings me to:

libpng.so was located in :
/data/installed/libpng/lib/libpng.so
/usr/lib/x86_64-linux-gnu/libpng.so

I suspect this has to do with ubuntu 12 storing these libs in
x86_64-linux-gnu instead of lib64

----

I just tried symlinking the libpng.so files to /usr/lib and the configure
and make runs without issues now.

Seems the problem is fixed :). Thanks for the tip.

Best regards,
P.


2012/5/10 thomas bonfort <thomas.bonfort at gmail.com>

> You're building with a custom libpng and the system libgd (linked to
> the system libpng),which is bad.
>
> try with --with-gd --with-png alone, after maybe apt-installing libpng-dev
>
> --
> thomas
>
> On Thu, May 10, 2012 at 11:21 AM, Peter Maes <thxftw at gmail.com> wrote:
> > I'm getting this error:
> >
> > gcc -c -O2 -fPIC -Wall  -DNDEBUG    -DHAVE_VSNPRINTF -DNEED_STRLCPY
> > -DNEED_STRLCAT -DNEED_STRRSTR     -DUSE_FASTCGI         -DUSE_LIBXML2
> >  -DUSE_WFS_SVR -DUSE_WMS_SVR    -DUSE_GDAL -DUSE_OGR -DUSE_GEOS
> >  -DUSE_THREAD -DUSE_PROJ    -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/data/installed/libpng/include
> -I/usr/include
> > -Irenderers/agg/include   -I/usr//include   -I/usr/include/gdal
> > -I/usr/include -I/data/installed/libiconv/include
> -I/usr/include/libxml2
> > shp2img.c -o shp2img.o
> > g++ -O2 -fPIC -Wall  -DNDEBUG    -DHAVE_VSNPRINTF -DNEED_STRLCPY
> > -DNEED_STRLCAT -DNEED_STRRSTR     -DUSE_FASTCGI         -DUSE_LIBXML2
> >  -DUSE_WFS_SVR -DUSE_WMS_SVR    -DUSE_GDAL -DUSE_OGR -DUSE_GEOS
> >  -DUSE_THREAD -DUSE_PROJ    -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/data/installed/libpng/include
> -I/usr/include
> > -Irenderers/agg/include   -I/usr//include   -I/usr/include/gdal
> > -I/usr/include -I/data/installed/libiconv/include
> -I/usr/include/libxml2
> > shp2img.o  -L. -lmapserver -L/usr/lib/x86_64-linux-gnu -lfreetype -lz
> > -L/usr/lib -lgd -ljpeg -L/usr/lib/x86_64-linux-gnu -lfreetype -lz
> > -L/data/installed/libpng/lib -lpng -lz -lXpm -lX11     -L/usr//lib -lproj
> > -ljpeg -L/data/installed/libpng/lib -lpng -lgif  -L/usr/lib -lgdal1.7.0
> > -L/usr/lib -lgeos_c -lpthread -L/data/installed/libiconv/lib -liconv
> -lfcgi
> >   -lz -L/usr/lib/x86_64-linux-gnu -lxml2  -lm -lstdc++    -o shp2img
> > ./libmapserver.a(mapimageio.o): In function `savePalettePNG':
> > mapimageio.c:(.text+0x8ef): undefined reference to `png_set_longjmp_fn'
> > ./libmapserver.a(mapimageio.o): In function `saveAsPNG':
> > mapimageio.c:(.text+0x113e): undefined reference to `png_set_longjmp_fn'
> > ./libmapserver.a(mapimageio.o): In function `readPNG':
> > mapimageio.c:(.text+0x1898): undefined reference to `png_set_longjmp_fn'
> > collect2: ld returned 1 exit status
> > make: *** [shp2img] Error 1
> >
> > libpng 1.2.46
> > iconv (Ubuntu EGLIBC 2.15-0ubuntu10) 2.15
> >
> > On Ubuntu 12.04 LTS with latest mapserver version.
> >
> > This is what my configure looks like:
> >
> > ./configure \
> >         --prefix=/data/installed/mapserver \
> >         --with-threads \
> >         --with-fastcgi  \
> >         --with-freetype=/usr/bin/freetype-config   \
> >         --with-zlib \
> >         --with-libiconv=/data/installed/libiconv \
> >         --with-gd=/usr \
> >         --with-ogr \
> >         --with-geos=/usr/bin/geos-config \
> >         --with-gdal \
> >         --with-png=/data/installed/libpng \
> >         --with-proj=/usr/ \
> >         --with-curl-config=/usr/bin/curl-config \
> >         --with-wfs \
> >
> > Thanks for any tips on how to make the build work.
> >
> >
> >
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120510/48230b2a/attachment.html


More information about the mapserver-users mailing list