Qt static library with jpeg support
Hi All,
I m using Qt 4.2.1 on my Mac Intel.
I want to bulid qt static library in release mode with jpeg support.
I configure using following command..
./configure -prefix /developer/qt -qt-zlib -qt-libjpeg -qt-libgif -universal -sdk
/developer/sdks/MacOsX10.4u.sdk -static -release
It is giving jpeg and jpeg support on configure output but after installing qt it is not giving support to the jpeg and gif images.
If any one knows the Issue then plzz help me.
thanks.
Re: Qt static library with jpeg support
AFAIR you have to enable a static plugin in a project that is to have JPEG support. Consult the docs about static plugins.
Re: Qt static library with jpeg support
It is well documented in the Qt docs.
Here is the link
In ur main.cpp add the following :-
#include <QApplication>
#include <QtPlugin>
Q_IMPORT_PLUGIN(qjpeg)
Q_IMPORT_PLUGIN(qgif)
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
...
return app.exec();
}
In your .pro file add the following:-
QTPLUGIN += qjpeg qgif
LIBS += -L 'path of the libjpeg.a and libgif.a files' -lqjpeg -lqgif
Happy Qtying (:))