Results 1 to 3 of 3

Thread: Static application MSVC 2005 no image

  1. #1
    Join Date
    Jan 2006
    Posts
    70
    Thanks
    13
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Static application MSVC 2005 no image

    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:
    Qt Code:
    1. TEMPLATE = app
    2. QT += opengl
    3. CONFIG += static
    4. QTPLUGIN += qjpeg
    5. RESOURCES += symbols.qrc
    6.  
    7. HEADERS += window.h
    8. SOURCES += window.cpp \
    9. main.cpp
    To copy to clipboard, switch view to plain text mode 

    Here is my .qrc file:
    Qt Code:
    1. <!DOCTYPE RCC><RCC version="1.0">
    2. <qresource>
    3. <file>symbols.jpeg</file>
    4. </qresource>
    5. </RCC>
    To copy to clipboard, switch view to plain text mode 

    Here is my main.cpp:
    Qt Code:
    1. #include <QApplication>
    2. #include <QtPlugin>
    3. #include "window.h"
    4.  
    5. Q_IMPORT_PLUGIN(qjpeg)
    6.  
    7. int main(int argc, char *argv[])
    8. {
    9. Q_INIT_RESOURCE(symbols);
    10. QApplication app(argc, argv);
    11. Window window;
    12. window.show();
    13. return app.exec();
    14. }
    To copy to clipboard, switch view to plain text mode 

    Here is my call to the image:
    Qt Code:
    1. QImage symbols = QImage(":/symbols.jpeg");
    To copy to clipboard, switch view to plain text mode 

    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?

  2. #2
    Join Date
    Jan 2006
    Posts
    70
    Thanks
    13
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static application MSVC 2005 no image

    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

  3. #3
    Join Date
    Jan 2006
    Posts
    70
    Thanks
    13
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static application MSVC 2005 no image

    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.

Similar Threads

  1. Building a static application using MS Visual C++ 2005
    By hunsrus in forum Installation and Deployment
    Replies: 1
    Last Post: 25th July 2008, 18:16
  2. Replies: 16
    Last Post: 23rd May 2008, 10:12
  3. Please Help-->have few doubts with Static build in Windows !
    By Krish in forum Installation and Deployment
    Replies: 1
    Last Post: 17th March 2008, 14:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.