Results 1 to 9 of 9

Thread: Images not shown in static release exe (QT4.4.0, commercial, windows)

  1. #1
    Join Date
    Jun 2008
    Posts
    26
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Images not shown in static release exe (QT4.4.0, commercial, windows)

    Hello Mates!

    for a long time i am searching for a solution concerning my problem - and i hope, that you can help me again.

    i am using MS Visual Studio Professional 2005 with SP1 installed and QT4.4.0 Commercial + VS Studio integration. The project i am working on can be compiled without any problems as Debug within VS 05 on my development-machine (WinXP). A release can be build unfortunately only on the commandline (qmake -project, qmake -makefile, nmake) but without any errors. I am unable to compile the Project within VS - for some unknown reason there pop up about 80 linker errors. Well - the problem is as follows:
    Debug - Exe: a QLabel can show Pixmaps
    Release - Exe (compiled on commandline): a QLabel doesnt show ANY pictures!!! i dont know why! for some reason resources cannot be displayed or what... i dont know. Wherefrom are those milions of linker errors (in VS! not in Commandline! mysterious..)? is there a connection to the way of building QT statically perhaps?

    i hope that description of my problem is understandable.

    please help me!

    sincerly

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Images not shown in static release exe (QT4.4.0, commercial, windows)

    Did you link your application with any imageformat plugins?

    http://doc.trolltech.com/4.4/plugins...static-plugins

  3. #3
    Join Date
    Jun 2008
    Posts
    26
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Images not shown in static release exe (QT4.4.0, commercial, windows)

    well, bardzo dziekuje za pomoc i followed the instructions on your page, really, thank you very much! but it does not work. now also on commandline i get those linker errors... do i have to recompile the qt as static library WITH explicit parameters for JPEG/GIF-Plugins? btw: bitmaps can be displayed properly.

    thank you!

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Images not shown in static release exe (QT4.4.0, commercial, windows)

    Quote Originally Posted by hunsrus View Post
    well, bardzo dziekuje za pomoc
    You are welcome.

    Quote Originally Posted by hunsrus View Post
    now also on commandline i get those linker errors...
    Could you post the exact error messages?

    In order to make static JPEG and GIF plugins work, you need:
    • Qt built in static mode,
    • Q_IMPORT_PLUGIN(qjpeg) and Q_IMPORT_PLUGIN(qgif) macros in your sources,
    • QTPLUGIN += qjpeg qgif in the .pro file

    Of course after changing the .pro file, you have to re-run qmake to get a new Makefile.

    Quote Originally Posted by hunsrus View Post
    do i have to recompile the qt as static library WITH explicit parameters for JPEG/GIF-Plugins?
    I don't remember. What files do you have in QTDIR/plugins/imageformats?

  5. #5
    Join Date
    Jun 2008
    Posts
    26
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Images not shown in static release exe (QT4.4.0, commercial, windows)

    the requested linker errors from commandline (yes, its german )
    moc_imagetest.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: static struct QMetaObject const QMainWindow::staticMetaObject" (?staticMetaObject@QMainWindow@@2UQMetaObject@@B)" .
    qtmain.lib(qtmain_win.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""private: static struct QByteArray:: Data QByteArray::shared_null" (?shared_null@QByteArray@@0UData@1@A)" in Funktion ""public: __thiscall QByteArray::QByteArray(void)" (??0QByteArray@@QAE@XZ)".
    qtmain.lib(qtmain_win.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: static enum QSysInfo::WinVersion const QSysInfo::WindowsVersion" (?WindowsVersion@QSysInfo@@2W4WinVersion@1@B)" in Funktion "_WinMain@16".
    C:\imagetest\Release\imagetest.exe : fatal error LNK1120: 3 nicht aufgelöste externe Verweise.
    qt is built statically with this command:
    Qt Code:
    1. configure.exe -static -release
    To copy to clipboard, switch view to plain text mode 
    and following
    Qt Code:
    1. nmake sub-src
    To copy to clipboard, switch view to plain text mode 

    and qmake -makefile was rerun after editing the .pro-file.

    in the plugins-folder/imageformats are qjpeg.lib (300kb) and qjpeg4.lib (2kb) - it seems to be built statically...




    edit: maybe that is interesting to know:
    the application icon is not shown when the app is statically release-built on commandline. BUT: when i build it non-statical as release, the icon is shown and the picture can be loaded from harddisk. so: some libraries are not included obviously... but how to include them?
    Last edited by jacek; 4th September 2008 at 01:17. Reason: changed [code] to [quote]

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Images not shown in static release exe (QT4.4.0, commercial, windows)

    These particular error messages don't concern the plugins. Maybe your linker mixes static and non-static libraries? Did you had a non-static Qt built in the same directory?

  7. #7
    Join Date
    Jun 2008
    Posts
    26
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Images not shown in static release exe (QT4.4.0, commercial, windows)

    indeed, qt static and qt dynamic were both in C:/Qt/
    i removed the dynamic version. but: the dynamic-version-folder could not be deleted! some process accessed it obviously. so i just copied the files from static-folder to the dynamic one, in hope it works fine. but it doesnt.

    i didnt post you those linker errors shown when i tried to compile with Q_IMPORT_PLUGIN etc. so ill do now:
    link /LIBPATH:"c:\Qt\4.4.0\lib" /NOLOGO /INCREMENTAL:NO /SUBSYSTEM:WINDO
    WS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' ve
    rsion='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitec
    ture='*'" /OUT:release\LTVKv2.exe @C:\DOKUME~1\LYTH\LOKALE~1\Temp\nm165.tmp
    main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""class
    QObject * __cdecl qt_plugin_instance_qjpeg(void)" (?qt_plugin_instance_qjpeg@@YA
    PAVQObject@@XZ)" in Funktion ""public: __thiscall StaticqjpegPluginInstance::Sta
    ticqjpegPluginInstance(void)" (??0StaticqjpegPluginInstance@@QAE@XZ)".
    release\LTVKv2.exe : fatal error LNK1120: 1 nicht aufgelöste externe Verweise.
    NMAKE : fatal error U1077: ""C:\Programme\Microsoft Visual Studio 8\VC\BIN\link.
    EXE"": Rückgabe-Code "0x460"
    Stop.
    NMAKE : fatal error U1077: ""C:\Programme\Microsoft Visual Studio 8\VC\BIN\nmake
    .exe"": Rückgabe-Code "0x2"
    Stop.


    thank you!

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Images not shown in static release exe (QT4.4.0, commercial, windows)

    As far as I understand the error message, the linker can't find StaticqjpegPluginInstance::StaticqjpegPluginInstan ce symbol, which means that you are not linking your application with the static plugin.

    Do you have CONFIG += static in your .pro file?

  9. #9
    Join Date
    Jun 2008
    Posts
    26
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Images not shown in static release exe (QT4.4.0, commercial, windows)

    hey! thanks for helping me. it works quite fine now.

    i followed your instructions and these ones from qt support:

    1) download and compile the source packages of qt as static release with all plugins needed
    2) copy it into a clean, fresh, new, virgin folder
    3) set up library paths in VS
    4) create vs-project with qmake -tp vc
    5) compile project with plugin-macros described above

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.