PDA

View Full Version : Qt Static Q_IMPORT_PLUGIN



bunjee
18th September 2007, 11:57
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 :


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 :


#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 ?

wysota
18th September 2007, 13:25
First of all don't touch "LIBS". Second of all make sure appropriate statuc plugin files are available.

bunjee
18th September 2007, 14:04
Where am I supposed to find static plugin files ?

in my \plugins\imageformats folder I have :

- libqjpeg.a
- libqjpeg4.a
- qjpeg4.dll

wysota
18th September 2007, 14:26
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?