PDA

View Full Version : Static application MSVC 2005 no image



bitChanger
18th August 2008, 02:42
I'm compiling a static application on Windows XP with MSVC 2005 Pro and Qt 4.4.1. Here is what I've done so far:

c:\Qt\4.4.1> configure -static -qt-libjpeg -release
c:\Qt\4.4.1> nmake sub-src

Here is my .pro file:


TEMPLATE = app
QT += opengl
CONFIG += static
QTPLUGIN += qjpeg
RESOURCES += symbols.qrc

HEADERS += window.h
SOURCES += window.cpp \
main.cpp


Here is my .qrc file:


<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>symbols.jpeg</file>
</qresource>
</RCC>


Here is my main.cpp:


#include <QApplication>
#include <QtPlugin>
#include "window.h"

Q_IMPORT_PLUGIN(qjpeg)

int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(symbols);
QApplication app(argc, argv);
Window window;
window.show();
return app.exec();
}


Here is my call to the image:


QImage symbols = QImage(":/symbols.jpeg");


This application compiles and works great on developer machine. After running it on another computer that does not have Qt or MSVC the application runs but the image does not show up.

I've read the Deployment manuals, the Plugin manuals, and a lot of posts on the forum for this topic. I'm still missing something. I've even tried .bmp, .gif. and now .jpeg.

Any ideas?

bitChanger
18th August 2008, 02:51
Here are the libs I link against:

c:\Qt\4.4.1\lib\qtmain.lib
c:\Qt\4.4.1\plugins/imageformats\qjpeg.lib
c:\Qt\4.4.1\lib\QtOpenGL.lib
c:\Qt\4.4.1\lib\QtGui.lib
c:\Qt\4.4.1\lib\QtCore.lib

bitChanger
26th August 2008, 13:06
This was so trivial, I can't believe I overlooked this. The computers that I have been trying to run the application on are a few years old. The graphics drivers use an older version of opengl which has very strict rules for image dimensions.

After changing my images to power of 2 dimensions (ex. 1024x64) they now appear on the remote computers. This restriction seems to be a little less strict with newer computers. One of the libraries on the newer computers must scale the images for you.

Anyway in order to make the application safe for all opengl platforms Qt + OpenGL must use images with dimensions in powers of 2!

I hope this helps someone else.
:o