[Qt-interest] Problem linking statically against MySQL plugin

Stephen Collyer scollyer at netspinner.co.uk
Fri Mar 20 17:17:21 CET 2009


I'm trying to make a fully static build of code which uses the MySQL plugin
on
Opensuse 11. with gcc 4.3 and Qt 4.5.0.

I'm getting the following error:

############################
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()'
############################

I'm using the following defines in the case of a static build:

#ifndef BUILD_SHARED_LIBS
#include <QtPlugin>
#define QT_STATICPLUGIN
Q_IMPORT_PLUGIN(qsqlmysql)
#endif

Can anyone suggest what I'm doing wrong ?

Steve Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090320/68f1921d/attachment.html 


More information about the Qt-interest-old mailing list