Those plugins are named "qjpeg", "qgif" and "qmng".
Those plugins are named "qjpeg", "qgif" and "qmng".
ht1 (14th January 2008)
The plugins that I have in my "plugins/imageformats" are not qjpeg, qgif and qmng. They are libqgif.a, libqjpeg.a, libqmng.a, libqsvg.a, libqtiff.a.
Does that mean I failed to build static plugins?
How do you build static plugins with mingw?
ht1 (14th January 2008)
Jacek, thanks,
Now myproject.pro is
but I'm still getting "cannot find -lqjpg". I tried to compile with and without this is main.cpp:Qt Code:
TEMPLATE = app TARGET = DEPENDPATH += . INCLUDEPATH += . CONFIG += staticlib QTPLUGIN += qjpg \ qgif \ qmngTo copy to clipboard, switch view to plain text mode
Q_IMPORT_PLUGIN(qjpeg)
Q_IMPORT_PLUGIN(qgif)
Q_IMPORT_PLUGIN(qmng)
but still I get the "cannot find -lqjpg" error.
Is there anything else I could try to diagnose the problem? Thanks
It should be qjpeg.
ht1 (15th January 2008)
Thanks, I changed "qjpg" to "qjpeg" in the *.pro file. Now the compiler says:
main.cpp: undefined reference to 'qt_plugin_instance_qjpeg()'
main.cpp: undefined reference to 'qt_plugin_instance_qgif()'
main.cpp: undefined reference to 'qt_plugin_instance_qmng()'
Is it possible that my static plugins are in the wrong folder? Where do they need to be?
I was wondering that perhaps there is something wrong with the way I declare the plugins in my main.cpp. This is how I do it:
Qt Code:
#include <QtPlugin> Q_IMPORT_PLUGIN(qjpeg) Q_IMPORT_PLUGIN(qgif) Q_IMPORT_PLUGIN(qmng)To copy to clipboard, switch view to plain text mode
Is there anyone out there who has compiled Qt4 statically and has linked imageformat plugins statically to the executable? I have tried just about every combination of everything but nothing works. This problem is causing me a major problems. Thanks!
Do you use qmake from the static Qt build?
ht1 (16th January 2008)
Yes, indeed, I use QMAKE from static Qt build. Also, I am able to incorporate other static plugins no problem, just not the imageformat static plugins. Taking these plugins out makes the program to compile fine but unable to handle image files (because the plugins were not incorporated). So, I think the compiler is fine and the code is fine. It's either that imageformat plugins have a problem, or I do not declare them right, or they are not in the right folder.
Could you post the command used to link your application (the one where the g++ is invoked with -l options)?
Do you get any other error messages apart from "undefined reference to qt_plugin_instance_xxx"?
ht1 (16th January 2008)
Great, Jacek, you may have figured out what the problem is. I do not know how to link properly using the command line. I've been doing:
1) prompt>qmake -project
2) then manually add the plugin info to the myproject.pro as shown in an earlier post
3) prompt>qmake
4) prompt>make
I guess I have to use -l in step 4?? How?
Thanks again
ht1 (16th January 2008)
Bookmarks