Skip to content
This repository

linker problems with mapserv #4296

Closed
bradh opened this Issue April 26, 2012 · 8 comments

2 participants

Brad Hards Thomas Bonfort
Brad Hards
bradh commented April 26, 2012

During compilation, I get to this:

/bin/bash ./libtool --mode=compile --tag=CC gcc -c -g  -Wall   -DUSE_PROJ_FASTPATHS    -DUSE_FASTCGI    -DUSE_EXSLT -DUSE_XSLT -DUSE_XMLMAPFILE -DUSE_WMS_LYR -DUSE_WFS_LYR -DUSE_SOS_SVR -DUSE_LIBXML2 -DUSE_CURL -DUSE_CURLOPT_PROXYAUTH   -DUSE_WCS_SVR -DUSE_WFS_SVR -DUSE_WMS_SVR   -DUSE_POSTGIS -DPOSTGIS_HAS_SERVER_VERSION -DUSE_GDAL -DUSE_OGR -DUSE_GEOS  -DUSE_THREAD -DUSE_PROJ   -DUSE_GD  -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_JPEG -DUSE_GIF -DUSE_PNG -DUSE_ZLIB -DUSE_FREETYPE -DHAVE_VSNPRINTF -DNEED_STRLCPY -DNEED_STRLCAT -DNEED_STRRSTR   -DDISABLE_CVSID  -I/usr/include/freetype2      -Irenderers/agg/include      -I/usr/local/include -I/usr/include/postgresql    -I/usr/local/include     -I/usr/include/libxml2      mapserv.c -o mapserv.lo
libtool: compile:  gcc -c -g -Wall -DUSE_PROJ_FASTPATHS -DUSE_FASTCGI -DUSE_EXSLT -DUSE_XSLT -DUSE_XMLMAPFILE -DUSE_WMS_LYR -DUSE_WFS_LYR -DUSE_SOS_SVR -DUSE_LIBXML2 -DUSE_CURL -DUSE_CURLOPT_PROXYAUTH -DUSE_WCS_SVR -DUSE_WFS_SVR -DUSE_WMS_SVR -DUSE_POSTGIS -DPOSTGIS_HAS_SERVER_VERSION -DUSE_GDAL -DUSE_OGR -DUSE_GEOS -DUSE_THREAD -DUSE_PROJ -DUSE_GD -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_JPEG -DUSE_GIF -DUSE_PNG -DUSE_ZLIB -DUSE_FREETYPE -DHAVE_VSNPRINTF -DNEED_STRLCPY -DNEED_STRLCAT -DNEED_STRRSTR -DDISABLE_CVSID -I/usr/include/freetype2 -Irenderers/agg/include -I/usr/local/include -I/usr/include/postgresql -I/usr/local/include -I/usr/include/libxml2 mapserv.c  -fPIC -DPIC -o .libs/mapserv.o
/bin/bash ./libtool --mode=link --tag=CXX g++ -rpath /usr/local/lib mapserv.lo libmapserver.la -o mapserv
libtool: link: g++ .libs/mapserv.o -o .libs/mapserv  ./.libs/libmapserver.so -Wl,-rpath -Wl,/usr/local/lib
/usr/bin/ld: .libs/mapserv.o: undefined reference to symbol 'FCGI_Accept'
/usr/bin/ld: note: 'FCGI_Accept' is defined in DSO /usr/lib/libfcgi.so.0 so try adding it to the linker command line
/usr/lib/libfcgi.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [mapserv] Error 1

I do have libfcgi.so.0 as shown above (as a symlink to /usr/lib/libfcgi.so.0.0.0), and it does appear to be picked up correctly by autoconf, with the Makefile containing

# Optional FastCGI
FASTCGI=-DUSE_FASTCGI
FASTCGI_INC=
FASTCGI_LIB=-lfcgi

That FASTCGI_LIB does appear in SUP_LIBS, and that in turn appears in EXE_LDFLAGS (around line 279 in Makefile.in / Makefile).

However EXE_LDFLAGS gets re-assigned to be $(LIBMAP) around line 324, and $(LIBMAP) is "libmapserver.la"

If I comment out the EXE_LDFLAGS re-assignment (line 324), then everything links OK and I get

$ ./mapserv
This script can only be used to decode form results and 
should be initiated as a CGI process via a httpd server.

However I don't really grog libtool, so I'm not sure what the real issue is here.

Thomas Bonfort
Owner

what platform are you building on?
if you open libmapserver.la, you should find the reference to -lfcgi that is getting picked up by libtool in dependency_libs="..." , is this the case?

Brad Hards
bradh commented May 25, 2012

I'm building on a Kubuntu 64 bit machine. I'll try to provide anything that might be relevant (sorry for not doing so up front):

$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
$ ld -v
GNU ld (GNU Binutils for Ubuntu) 2.21.53.20110810

I've updated to current git (after a reset --hard, so should be no local changes)

using bootstrap.sh with this content:
autoreconf --force
./configure --with-ogr=/usr/local/bin/gdal-config \
--with-gdal=/usr/local/bin/gdal-config \
--with-wfsclient \
--with-wmsclient \
--with-wfs \
--with-fastcgi=yes \
--enable-debug \
--with-curl-config=/usr/bin/curl-config \
--with-proj=yes \
--with-gd=yes \
--with-jpeg \
--with-freetype=yes \
--with-threads \
--with-wcs \
--with-postgis=yes \
--with-libiconv=/usr \
--with-geos=yes \
--with-libiconv=yes \
--with-xml2-config=yes \
--with-sos \
--with-proj=yes \
--enable-proj-fastpath \
--with-xml-mapfile=yes \
--with-xslt=yes

Finishes with:
-------------- Compiler Info -------------
C compiler: gcc -g -Wall

C++ compiler: g++ -g -Wall

Debug: -g
Generic NINT:

-------------- Renderer Settings ---------
OpenGL support:

zlib support: -DUSE_ZLIB
png support: -DUSE_PNG
gif support: -DUSE_GIF
jpeg support: -DUSE_JPEG
freetype support: -DUSE_FREETYPE
iconv support: -DUSE_ICONV
AGG support: internal
GD support: -DUSE_GD
Cairo (SVG,PDF) support:

Cairo SVG symbol support:

KML support:

-------------- Support Libraries ---------
Proj.4 support: -DUSE_PROJ
Proj Fastpaths: -DUSE_PROJ_FASTPATHS
Libxml2 support: -DUSE_LIBXML2
FriBidi support:

Curl support: -DUSE_CURL -DUSE_CURLOPT_PROXYAUTH
FastCGI support: -DUSE_FASTCGI
Exempi support:

Threading support: -DUSE_THREAD
GEOS support: -DUSE_GEOS
XML Mapfile support: -DUSE_XMLMAPFILE
XSLT support: -DUSE_XSLT
EXSLT support: -DUSE_EXSLT

-------------- Data Format Drivers -------
PostGIS support: -DUSE_POSTGIS -DPOSTGIS_HAS_SERVER_VERSION
ArcSDE support:

OGR support: -DUSE_OGR
GDAL support: -DUSE_GDAL
Oracle Spatial support:

-------------- OGC Services --------------
WMS Server: -DUSE_WMS_SVR
WMS Client: -DUSE_WMS_LYR
WFS Server: -DUSE_WFS_SVR
WFS Client: -DUSE_WFS_LYR
WCS Server: -DUSE_WCS_SVR
SOS Server: -DUSE_SOS_SVR

-------------- MapScript -----------------
PHP MapScript: no
Python MapScript: no

The build (make step) dies at
/bin/bash ./libtool --mode=compile --tag=CC gcc -c -g -Wall -DUSE_PROJ_FASTPATHS -DUSE_FASTCGI -DUSE_EXSLT -DUSE_XSLT -DUSE_XMLMAPFILE -DUSE_WMS_LYR -DUSE_WFS_LYR -DUSE_SOS_SVR -DUSE_LIBXML2 -DUSE_CURL -DUSE_CURLOPT_PROXYAUTH -DUSE_WCS_SVR -DUSE_WFS_SVR -DUSE_WMS_SVR -DUSE_POSTGIS -DPOSTGIS_HAS_SERVER_VERSION -DUSE_GDAL -DUSE_OGR -DUSE_GEOS -DHAVE_SYNC_FETCH_AND_ADD -DUSE_THREAD -DUSE_PROJ -DUSE_GD -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_JPEG -DUSE_GIF -DUSE_PNG -DUSE_ZLIB -DUSE_FREETYPE -DHAVE_VSNPRINTF -DNEED_STRLCPY -DNEED_STRLCAT -DNEED_STRRSTR -DDISABLE_CVSID -I/usr/include/freetype2 -Irenderers/agg/include -I/usr/local/include -I/usr/include/postgresql -I/usr/local/include -I/usr/include/libxml2 mapserv.c -o mapserv.lo
libtool: compile: gcc -c -g -Wall -DUSE_PROJ_FASTPATHS -DUSE_FASTCGI -DUSE_EXSLT -DUSE_XSLT -DUSE_XMLMAPFILE -DUSE_WMS_LYR -DUSE_WFS_LYR -DUSE_SOS_SVR -DUSE_LIBXML2 -DUSE_CURL -DUSE_CURLOPT_PROXYAUTH -DUSE_WCS_SVR -DUSE_WFS_SVR -DUSE_WMS_SVR -DUSE_POSTGIS -DPOSTGIS_HAS_SERVER_VERSION -DUSE_GDAL -DUSE_OGR -DUSE_GEOS -DHAVE_SYNC_FETCH_AND_ADD -DUSE_THREAD -DUSE_PROJ -DUSE_GD -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_JPEG -DUSE_GIF -DUSE_PNG -DUSE_ZLIB -DUSE_FREETYPE -DHAVE_VSNPRINTF -DNEED_STRLCPY -DNEED_STRLCAT -DNEED_STRRSTR -DDISABLE_CVSID -I/usr/include/freetype2 -Irenderers/agg/include -I/usr/local/include -I/usr/include/postgresql -I/usr/local/include -I/usr/include/libxml2 mapserv.c -fPIC -DPIC -o .libs/mapserv.o
/bin/bash ./libtool --mode=link --tag=CXX g++ -rpath /usr/local/lib mapserv.lo libmapserver.la -o mapserv
libtool: link: g++ .libs/mapserv.o -o .libs/mapserv ./.libs/libmapserver.so -Wl,-rpath -Wl,/usr/local/lib
/usr/bin/ld: .libs/mapserv.o: undefined reference to symbol 'FCGI_Accept'
/usr/bin/ld: note: 'FCGI_Accept' is defined in DSO /usr/lib/libfcgi.so.0 so try adding it to the linker command line
/usr/lib/libfcgi.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [mapserv] Error 1

In libmapserver.la, I see:
dependency_libs=' /usr/lib/libgd.la /usr/lib/x86_64-linux-gnu/libfreetype.la -lXpm -lX11 /usr/lib/libproj.la -L/usr/local/lib /usr/local/lib/libgdal.la /usr/lib/x86_64-linux-gnu/libsqlite3.la /usr/lib/x86_64-linux-gnu/libexpat.la /usr/local/lib/libNCSEcw.la /usr/local/lib/libNCSEcwC.la /usr/local/lib/libNCSCnet.la /usr/local/lib/libNCSUtil.la /usr/lib/x86_64-linux-gnu/libjasper.la /usr/lib/libgif.la /usr/lib/x86_64-linux-gnu/libjpeg.la -lpng -L/usr/lib -lrt -ldl -lpq /usr/lib/x86_64-linux-gnu/libcurl.la /usr/local/lib/libgeos_c.la /usr/local/lib/libgeos.la -lpthread /usr/lib/libfcgi.la -lnsl /usr/lib/libxslt.la /usr/lib/libexslt.la -lz /usr/lib/libxml2.la'

So there is a /usr/lib/libfcgi.la (although I don't see -lfcgi). /usr/lib/libfcgi.la exists, and contains (in part):

The name that we can dlopen(3).

dlname='libfcgi.so.0'

Names of this library.

library_names='libfcgi.so.0.0.0 libfcgi.so.0 libfcgi.so'

The name of the static archive.

old_library='libfcgi.a'

Thomas Bonfort tbonfort closed this May 26, 2012
Thomas Bonfort
Owner

Installed an 11.10 kubuntu 64bit VM

unable to reproduce with

./configure --with-gdal --with-postgis --with-fastcgi --with-proj --with-ogr

also unable to reproduce with

./configure --with-ogr --with-gdal --with-wfsclient --with-wmsclient --with-wfs --with-fastcgi=yes\
 --enable-debug --with-curl-config=/usr/bin/curl-config --with-proj=yes --with-gd --with-jpeg \
--with-freetype=yes --with-threads \
--with-wcs --with-postgis=yes  --with-geos=yes --with-libiconv=yes --with-xml2-config=yes --with-sos\
 --with-proj=yes --enable-proj-fastpath --with-xml-mapfile=yes --with-xslt=yes

however, running autoreconf --force as you are doing allows me to reproduce your error. Closing as invalid as you are breaking mapserver's build system yourself. If you do investigate further and determine why 11.10's autoconf is breaking our builds, then please do comment back in this ticket.

Thomas Bonfort tbonfort reopened this May 26, 2012
Thomas Bonfort
Owner

Actually I think there might be an underlying issue that is showing up with certain libtool versions:
This is what I'm groking:

  • when building with fastcgi support, fastcgi functions are only called in mapserv.c, and are not present in libmapserver.so
  • we link libmapserver.so against -lfcgi which is not necessary as there are no libfcgi links that need to happen
  • we link mapserv against libmapserver.so, which might have dropped the reference to libfcgi

I'll try adding -lfcgi to the mapserv linkage, and remove it from the libmapserver.la one, and report back...

Thomas Bonfort tbonfort referenced this issue from a commit in tbonfort/mapserver May 26, 2012
Thomas Bonfort change linking against libfastcgi (#4296)
fastcgi functions are only called by the mapserv binary,
so the fastcgi headers and library only needs to be
referenced when compiling/linking mapserv.c.

this patch moves the fastcgi io handlers from mapio.c to
mapserv.c, and changes the compilation flags so that
libmapserver.so is not linked against libfcgi. libfcgi
is now linked only against mapserv.

this patch closes #4296
8839370
Thomas Bonfort
Owner

@bradh can you test with the proposed patch and report back ?

@warmerdam, I'm pretty confident about the proposed patch, but would be reassured if you could have a quick look at it as your experience with fastcgi and windows makes you somewhat more knowledgeable about fastcgi than I am. thanks.

Brad Hards
bradh commented May 26, 2012

I tried https://github.com/tbonfort/mapserver/tree/b4296-libtool and it compiles fine if I don't do the autoreconf --force stage.

If I do the autoreconf --force stage, the compilation stage dies with:
/bin/bash ./libtool --mode=compile --tag=CC gcc -c -g -Wall -DUSE_PROJ_FASTPATHS -DUSE_FASTCGI -DUSE_EXSLT -DUSE_XSLT -DUSE_XMLMAPFILE -DUSE_WMS_LYR -DUSE_WFS_LYR -DUSE_SOS_SVR -DUSE_LIBXML2 -DUSE_CURL -DUSE_CURLOPT_PROXYAUTH -DUSE_WCS_SVR -DUSE_WFS_SVR -DUSE_WMS_SVR -DUSE_POSTGIS -DPOSTGIS_HAS_SERVER_VERSION -DUSE_GDAL -DUSE_OGR -DUSE_GEOS -DUSE_THREAD -DUSE_PROJ -DUSE_GD -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_JPEG -DUSE_GIF -DUSE_PNG -DUSE_ZLIB -DUSE_FREETYPE -DHAVE_VSNPRINTF -DNEED_STRLCPY -DNEED_STRLCAT -DNEED_STRRSTR -DDISABLE_CVSID -I/usr/include/freetype2 -Irenderers/agg/include -I/usr/local/include -I/usr/include/postgresql -I/usr/local/include -I/usr/include/libxml2 mapserv.c -o mapserv.lo
libtool: compile: gcc -c -g -Wall -DUSE_PROJ_FASTPATHS -DUSE_FASTCGI -DUSE_EXSLT -DUSE_XSLT -DUSE_XMLMAPFILE -DUSE_WMS_LYR -DUSE_WFS_LYR -DUSE_SOS_SVR -DUSE_LIBXML2 -DUSE_CURL -DUSE_CURLOPT_PROXYAUTH -DUSE_WCS_SVR -DUSE_WFS_SVR -DUSE_WMS_SVR -DUSE_POSTGIS -DPOSTGIS_HAS_SERVER_VERSION -DUSE_GDAL -DUSE_OGR -DUSE_GEOS -DUSE_THREAD -DUSE_PROJ -DUSE_GD -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_JPEG -DUSE_GIF -DUSE_PNG -DUSE_ZLIB -DUSE_FREETYPE -DHAVE_VSNPRINTF -DNEED_STRLCPY -DNEED_STRLCAT -DNEED_STRRSTR -DDISABLE_CVSID -I/usr/include/freetype2 -Irenderers/agg/include -I/usr/local/include -I/usr/include/postgresql -I/usr/local/include -I/usr/include/libxml2 mapserv.c -fPIC -DPIC -o .libs/mapserv.o
/bin/bash ./libtool --mode=link --tag=CXX g++ -rpath /usr/local/lib mapserv.lo libmapserver.la -o mapserv
libtool: link: g++ .libs/mapserv.o -o .libs/mapserv ./.libs/libmapserver.so -Wl,-rpath -Wl,/usr/local/lib
/usr/bin/ld: .libs/mapserv.o: undefined reference to symbol 'FCGI_Accept'
/usr/bin/ld: note: 'FCGI_Accept' is defined in DSO /usr/lib/libfcgi.so.0 so try adding it to the linker command line
/usr/lib/libfcgi.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [mapserv] Error 1

libtool claims to be:
$ libtool --version
libtool (GNU libtool) 2.4
Written by Gordon Matzigkeit gord@gnu.ai.mit.edu, 1996

Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I'll test again on a more recent distribution.

Brad Hards
bradh commented May 26, 2012

That URL should have been https://github.com/tbonfort/mapserver.git

I tried that same git tree on an ubuntu 12.04, with all the updates. libtool is 2.4.2

It works OK without the autoreconf --force bit. It dies with
[[[
libtool: link: g++ .libs/legend.o -o .libs/legend ./.libs/libmapserver.so -Wl,-rpath -Wl,/usr/local/lib
/bin/bash ./libtool --mode=compile --tag=CC gcc -c -g -Wall -DUSE_PROJ_FASTPATHS -DUSE_FASTCGI -DUSE_EXSLT -DUSE_XSLT -DUSE_XMLMAPFILE -DUSE_WMS_LYR -DUSE_WFS_LYR -DUSE_SOS_SVR -DUSE_LIBXML2 -DUSE_CURL -DUSE_CURLOPT_PROXYAUTH -DUSE_WCS_SVR -DUSE_WFS_SVR -DUSE_WMS_SVR -DUSE_POSTGIS -DPOSTGIS_HAS_SERVER_VERSION -DUSE_GDAL -DUSE_OGR -DUSE_GEOS -DUSE_THREAD -DUSE_PROJ -DUSE_GD -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_JPEG -DUSE_GIF -DUSE_PNG -DUSE_ZLIB -DUSE_FREETYPE -DHAVE_VSNPRINTF -DNEED_STRLCPY -DNEED_STRLCAT -DNEED_STRRSTR -DDISABLE_CVSID -I/usr/include/freetype2 -I/usr/include -Irenderers/agg/include -I/usr/include/gdal -I/usr/include/postgresql -I/usr/local/include -I/usr/include/libxml2 mapserv.c -o mapserv.lo
libtool: compile: gcc -c -g -Wall -DUSE_PROJ_FASTPATHS -DUSE_FASTCGI -DUSE_EXSLT -DUSE_XSLT -DUSE_XMLMAPFILE -DUSE_WMS_LYR -DUSE_WFS_LYR -DUSE_SOS_SVR -DUSE_LIBXML2 -DUSE_CURL -DUSE_CURLOPT_PROXYAUTH -DUSE_WCS_SVR -DUSE_WFS_SVR -DUSE_WMS_SVR -DUSE_POSTGIS -DPOSTGIS_HAS_SERVER_VERSION -DUSE_GDAL -DUSE_OGR -DUSE_GEOS -DUSE_THREAD -DUSE_PROJ -DUSE_GD -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_JPEG -DUSE_GIF -DUSE_PNG -DUSE_ZLIB -DUSE_FREETYPE -DHAVE_VSNPRINTF -DNEED_STRLCPY -DNEED_STRLCAT -DNEED_STRRSTR -DDISABLE_CVSID -I/usr/include/freetype2 -I/usr/include -Irenderers/agg/include -I/usr/include/gdal -I/usr/include/postgresql -I/usr/local/include -I/usr/include/libxml2 mapserv.c -fPIC -DPIC -o .libs/mapserv.o
/bin/bash ./libtool --mode=link --tag=CXX g++ -rpath /usr/local/lib mapserv.lo libmapserver.la -o mapserv
libtool: link: g++ .libs/mapserv.o -o .libs/mapserv ./.libs/libmapserver.so -Wl,-rpath -Wl,/usr/local/lib
/usr/bin/ld: .libs/mapserv.o: undefined reference to symbol 'FCGI_Accept'
/usr/bin/ld: note: 'FCGI_Accept' is defined in DSO /usr/lib/libfcgi.so.0 so try adding it to the linker command line
/usr/lib/libfcgi.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [mapserv] Error 1
]]]

if I do the autoreconf --force.

So I guess the answer is "don't do that".

Do you have an alternative set of autotools rebuild steps that you use?

Thomas Bonfort
Owner

I suspect you're not using the correct branch. you must checkout b4296-libtool. With that branch, the linking becomes

/bin/bash ./libtool --mode=link [snip] libmapserver.la [-L/path/to/fcgi/lib] -lfcgi  -o mapserv

instead of

/bin/bash ./libtool --mode=link [snip] libmapserver.la -o mapserv

That version should work with your autoconf version.

Thomas Bonfort tbonfort closed this issue from a commit May 26, 2012
Thomas Bonfort change linking against libfastcgi (#4296)
fastcgi functions are only called by the mapserv binary,
so the fastcgi headers and library only needs to be
referenced when compiling/linking mapserv.c.

this patch moves the fastcgi io handlers from mapio.c to
mapserv.c, and changes the compilation flags so that
libmapserver.so is not linked against libfcgi. libfcgi
is now linked only against mapserv.

this patch closes #4296
8839370
Thomas Bonfort tbonfort closed this in 8839370 June 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.