Hi

Trying out a static build of Qt and am having problems getting the qt gif support to link in even when using Q_IMPORT_PLUGIN(qgif)

E.g if I build Qt (4.62, using VS 2008 on a vista box) using
configure -static -commercial -debug -qt-zlib -qt-libpng -qt-libtiff -qt-libjpeg -qt-gif -webkit -script -scripttools -no-phonon -no-phonon-backend -no-dbus -qt-sql-sqlite

...then I noticed that the Qt demo app 'browser' works fine but it does not display gif images.

Now I understand that with a statically linked Qt library you have to manually get the plugins linked in so I modified browsermainwindow.cpp to include:

#include <QApplication>
#include <QtPlugin>
Q_IMPORT_PLUGIN(qgif)


and I altered the .pro file to include
QTPLUGIN += qgif


... and then did qmake and a rebuild but now I get a linker error with


1>Linking...
1>LINK : debug\browser.exe not found or not built by the last incremental link; performing full link
1>LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
1> Creating library debug\browser.lib and object debug\browser.exp
1>browsermainwindow.obj : error LNK2019: unresolved external symbol "class QObject * __cdecl qt_plugin_instance_qgif(void)" (?qt_plugin_instance_qgif@@YAPAVQObject@@XZ) referenced in function "public: __thiscall StaticqgifPluginInstance::StaticqgifPluginInstance (void)" (??0StaticqgifPluginInstance@@QAE@XZ)
1>debug\browser.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Qt\qt-everywhere-commercial-src-4.6.2\demos\browser\tmp\obj\debug_static\BuildLog. htm"
1>browser - 2 error(s), 1 warning(s)

What am I doing wrong?

Also, where in the Qt code does it control which plugins are automatically available in a statically linked app without having to do anything special? E.g. I noticed that the JPEG image plugin is automatically available within the statically linked browser demo without it having to use Q_IMPORT_PLUGIN. There must be some place within the Qt source where this is controlled.

Thanks for any suggestions.