[CMake] Link error when building static exe against static Qt 4.5 plugin

Stephen Collyer scollyer at netspinner.co.uk
Mon Mar 23 04:16:35 EDT 2009


I'm trying to build a fully static exe on Opensuse 11.1 against a static
build of Qt 4.5, and
I'm trying to link against a static QMySQL plugin.

I'm getting a link error when I do so, and I suspect it's because I'm not
telling LINK_LIBRARIES how
to link against the static plugin.

/usr/bin/c++   -O3 -DNDEBUG  -fPIC
CMakeFiles/file_transfer_scheduler_exe.dir/file_transfer_scheduler.o  -o
file_transfer_scheduler_exe -rdynamic
-L/usr/local/Trolltech/Qt-4.5.0-static/lib ../lib/libFileTransferScheduler.a
../lib/libSSHPrivateKey.a ../lib/libIPCListener.a ../lib/libComms.a
../lib/libExceptions.a ../lib/libSupport.a
/usr/local/Trolltech/Qt-4.5.0-static/lib/libQtGui.a -lpng -lSM -lICE
-lXrender -lfreetype -lfontconfig -lXext -lX11 -lm
/usr/local/Trolltech/Qt-4.5.0-static/lib/libQtXml.a
/usr/local/Trolltech/Qt-4.5.0-static/lib/libQtSql.a
/usr/local/Trolltech/Qt-4.5.0-static/lib/libQtNetwork.a -lssl
/usr/local/Trolltech/Qt-4.5.0-static/lib/libQtCore.a -lz -lgthread-2.0
-lglib-2.0 -lrt -lpthread -ldl ../lib/libClientCertificate.a
../lib/libServer.a ../lib/libUIObject.a ../lib/libTimedMessages.a
../lib/libTransferrers.a ../plugins/libcurlPlugin.a ../lib/libHTTP.a -lcurl
../lib/libCommonProperties.a ../lib/libRunnable.a ../lib/libComms.a
../lib/libPersistence.a ../lib/libRunQuery.a ../lib/libSupport.a
../lib/libLogger.a ../lib/libExceptions.a ../lib/libAgentSettings.a
/usr/local/Trolltech/Qt-4.5.0-static/lib/libQtGui.a -lpng -lSM -lICE
-lXrender -lfreetype -lfontconfig -lXext -lX11 -lm
/usr/local/Trolltech/Qt-4.5.0-static/lib/libQtXml.a
/usr/local/Trolltech/Qt-4.5.0-static/lib/libQtSql.a
/usr/local/Trolltech/Qt-4.5.0-static/lib/libQtNetwork.a -lssl
/usr/local/Trolltech/Qt-4.5.0-static/lib/libQtCore.a -lz -lgthread-2.0
-lglib-2.0 -lrt -lpthread -ldl
-Wl,-rpath,/usr/local/Trolltech/Qt-4.5.0-static/lib
CMakeFiles/file_transfer_scheduler_exe.dir/file_transfer_scheduler.o: In
function `global constructors keyed to
_Z15log_start_statetRK7QStringS1_S1_S1_':
file_transfer_scheduler.cpp:(.text+0x91): undefined reference to
`qt_plugin_instance_qsqlmysql()'

Can anyone suggest what I'm screwing up here ? I'm guessing that I need to
do something different
than merely link against ${QT_LIBRARIES} but I'm not sure what.

Steve Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090323/8224e99c/attachment.htm>


More information about the CMake mailing list