PDA

View Full Version : Problem using QtPlugin



merry
27th March 2008, 06:43
Hi all

I am working on Qt4.3.4 on Windows XP .

To preview Image formats , I tried to use QtPlugin.

in .pro file, I add

QTPLUGIN += qjpeg qgif

in main.cpp file , I add

Q_IMPORT_PLUGIN(qjpeg)
Q_IMPORT_PLUGIN(qgif)

But I got some linking error


main.obj : error LNK2019: unresolved external symbol "class QObject * __cdecl qt_plugin_instance_qjpeg(void)" (?qt_plugin_instance_qjpeg@@YAPAVQObject@@XZ) referenced in function "public: __thiscall StaticqjpegPluginInstance::StaticqjpegPluginInstan ce(void)" (??0StaticqjpegPluginInstance@@QAE@XZ)
main.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)



What to do?

Regards
Merry

jpn
27th March 2008, 07:31
First of all, this stuff is for static plugins so are you using a static version of Qt? Secondly, did you compile JPEG and GIF support while compiling the static version of Qt?

merry
27th March 2008, 07:38
No I am not Using static version of Qt.

Can you pls tell me how to add Plugins.

jpn
27th March 2008, 07:43
What do you mean with "add plugins"? They are loaded out of the box.

merry
27th March 2008, 07:45
Sorry, but how to use these plugins,

jpn
27th March 2008, 07:49
What do you want to do? Why do you need access to individual plugins? It's all done transparently for you. You can check supported formats via:

QImageReader::supportedImageFormats()
QImagewriter::supportedImageFormats()