PDA

View Full Version : Qt static library with jpeg support



vishal.chauhan
1st May 2007, 13:22
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.

wysota
10th May 2007, 23:25
AFAIR you have to enable a static plugin in a project that is to have JPEG support. Consult the docs about static plugins.

tiva
11th May 2007, 06:53
It is well documented in the Qt docs.
Here is the link (http://doc.trolltech.com/4.2/plugins-howto.html#static-plugins)

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 (:))