Subject: shared library help
To: None <netbsd-help@netbsd.org>
From: Brook Milligan <brook@biology.nmsu.edu>
List: netbsd-help
Date: 09/22/2006 08:36:31
I am trying to compile a program that builds shared libraries to be
loaded at runtime with dlopen.  This program uses libtool during the
build process.  The problem is that it is not building the shared
libraries, only static ones.  Can anyone help me discover where the
problem lies?  A transcript of a portion of the build appears below.
Please not the final warning message that I believe is coming from
libtool.

Thanks for your help.

Cheers,
Brook

===========================================================================
if /usr/pkg/bin/bash ../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../core/ -I../../gui   -I/usr/pkg/include  -DQT3_SUPPORT -I/usr/pkg/qt4/mkspecs/default -I/usr/pkg/qt4/include/Qt3Support -I/usr/pkg/qt4/include/QtCore -I/us\
r/pkg/qt4/include/QtDesigner -I/usr/pkg/qt4/include/QtGui -I/usr/pkg/qt4/include/QtNetwork -I/usr/pkg/qt4/include/QtOpenGL -I/usr/pkg/qt4/include/QtSql -I/usr/pkg/qt4/include/QtXml -I/usr/pkg/qt4/include -I/usr/pkg/qt4/include/QtSvg -I/usr/pkg/qt4/include/QtTest -\
I/usr/pkg/qt4/include/QtDesigner -D_REENTRANT -DQT_THREAD_SUPPORT -DNO_DEBUG -I/usr/pkg/include -g -O2 -MT ogrprovider_la-qgsogrprovider.lo -MD -MP -MF ".deps/ogrprovider_la-qgsogrprovider.Tpo" -c -o ogrprovider_la-qgsogrprovider.lo `test -f 'qgsogrprovider.cpp' |\
| echo './'`qgsogrprovider.cpp; \
	then mv -f ".deps/ogrprovider_la-qgsogrprovider.Tpo" ".deps/ogrprovider_la-qgsogrprovider.Plo"; else rm -f ".deps/ogrprovider_la-qgsogrprovider.Tpo"; exit 1; fi
mkdir .libs
 g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../core/ -I../../gui -I/pkg_comp/obj/pkgsrc/wip/qgis8/work.pkg_comp/.buildlink/include -DQT3_SUPPORT -I/usr/pkg/qt4/mkspecs/default -I/usr/pkg/qt4/include/Qt3Support -I/usr/pkg/qt4/include/QtCore -I/usr/pkg/qt4/include/QtDe\
signer -I/usr/pkg/qt4/include/QtGui -I/usr/pkg/qt4/include/QtNetwork -I/usr/pkg/qt4/include/QtOpenGL -I/usr/pkg/qt4/include/QtSql -I/usr/pkg/qt4/include/QtXml -I/usr/pkg/qt4/include -I/usr/pkg/qt4/include/QtSvg -I/usr/pkg/qt4/include/QtTest -D_REENTRANT -DQT_THREA\
D_SUPPORT -DNO_DEBUG -g -O2 -MT ogrprovider_la-qgsogrprovider.lo -MD -MP -MF .deps/ogrprovider_la-qgsogrprovider.Tpo -c qgsogrprovider.cpp  -fPIC -DPIC -o .libs/ogrprovider_la-qgsogrprovider.o
 g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../core/ -I../../gui -I/pkg_comp/obj/pkgsrc/wip/qgis8/work.pkg_comp/.buildlink/include -DQT3_SUPPORT -I/usr/pkg/qt4/mkspecs/default -I/usr/pkg/qt4/include/Qt3Support -I/usr/pkg/qt4/include/QtCore -I/usr/pkg/qt4/include/QtDe\
signer -I/usr/pkg/qt4/include/QtGui -I/usr/pkg/qt4/include/QtNetwork -I/usr/pkg/qt4/include/QtOpenGL -I/usr/pkg/qt4/include/QtSql -I/usr/pkg/qt4/include/QtXml -I/usr/pkg/qt4/include -I/usr/pkg/qt4/include/QtSvg -I/usr/pkg/qt4/include/QtTest -D_REENTRANT -DQT_THREA\
D_SUPPORT -DNO_DEBUG -g -O2 -MT ogrprovider_la-qgsogrprovider.lo -MD -MP -MF .deps/ogrprovider_la-qgsogrprovider.Tpo -c qgsogrprovider.cpp -o ogrprovider_la-qgsogrprovider.o >/dev/null 2>&1
/usr/pkg/bin/bash ../../../libtool --tag=CXX --mode=link g++  -g -O2   -o ogrprovider.la -rpath /usr/pkg/lib/qgis -avoid-version -module ogrprovider_la-qgsogrprovider.lo -L/usr/pkg/qt4/lib -lQtCore -lQt3Support -lQtGui -lQtNetwork -lQtSvg -lpthread  -L/usr/pkg/lib\
 -lgdal -L/usr/pkg/lib -lgeos ../../core/libqgis_core.la ../../gui/libqgis_gui.la -lutil

*** Warning: This system can not link to static lib archive /pkg_comp/obj/pkgsrc/wip/qgis8/work.pkg_comp/.buildlink/lib/libgdal.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
*** But as you try to build a module library, libtool will still create
*** a static module, that should work as long as the dlopening application
*** is linked with the -dlopen flag to resolve symbols at runtime.
ar cru .libs/ogrprovider.a  ogrprovider_la-qgsogrprovider.o
ranlib .libs/ogrprovider.a
creating ogrprovider.la
(cd .libs && rm -f ogrprovider.la && ln -s ../ogrprovider.la ogrprovider.la)