Qt Static Q_IMPORT_PLUGIN
Hey trollitechies,
I'm compiling a static qt lib with this line :
configure -static -qt-gif -qt-zlib -qt-libmng -qt-libpng -qt-libjpeg -plugin-sql-sqlite -plugin-sql-odbc
then I'm building it like that :
mingw32-make sub-src
And then I'm adding :
Code:
QTPLUGIN += qjpeg \
qgif
//and
LIBS += -L../../../Qt/4.3.0.static/plugins/imageformats/ -lqjpeg -lqgif\
to the .pro file.
and this in the main.cpp :
Code:
#include <QtPlugin>
Q_IMPORT_PLUGIN(qjpeg)
Q_IMPORT_PLUGIN(qgif)
But :
When compiling I get an undefined reference to qt_plugin_instance_qjpeg and qt_plugin_instance_qgif().
What am I doing wrong ?
Re: Qt Static Q_IMPORT_PLUGIN
First of all don't touch "LIBS". Second of all make sure appropriate statuc plugin files are available.
Re: Qt Static Q_IMPORT_PLUGIN
Where am I supposed to find static plugin files ?
in my \plugins\imageformats folder I have :
- libqjpeg.a
- libqjpeg4.a
- qjpeg4.dll
Re: Qt Static Q_IMPORT_PLUGIN
These seem ok provided that you compile your application in release mode and that those .a files are static libraries and not import libraries for the dll. There is no gif plugin here though, so you won't be able to use it. Are you sure this is the result of the configure line you have mentioned in your first post? Are you sure those plugins were actually built?