August 9, 2010

Andrey Maslennikov Andrey Maslennikov
Lab Rat
6 posts

Problem with link resources to executable file

 

Hello!

I have a problem with resources link. I have a splash screen in my app (and other pictures). Resources.qrc file has all of them. In pro-file I have follow line:

  1. RESOURCES = ./resources/resources.qrc

In main.cpp file I do follow:
  1. int main(int argc, char *argv[])
  2. {
  3.     Q_INIT_RESOURCE(resources);
  4.     QApplication app(argc, argv);
  5.     ...
  6.     QSplashScreen splash(QPixmap(":/images/splash.jpg"));
  7.     ...

And it works properly on my laptop. But when I execute my app on other machine I have no resources loaded…

Could you tell me what I do wrong?

Thanks in advance!

UPD:
The same behavior without line

  1. Q_INIT_RESOURCE(resources);

Also I tried to compile my project with VS2008 (using special Qt build and vs-addin). And again this problem: it works properly on my laptop and there no images on other machines.

 Signature 

BR, Andrey

5 replies

August 9, 2010

sagod sagod
Lab Rat
1 posts

Hi, Andrew.

How about using png images? It’s work for me :)

August 9, 2010

Vass Vass
Ant Farmer
740 posts

Hi Andrey.

Really, you must provide Qt JPEG plugin(libqjpeg.so or libqjpeg.dll) with your app, if you want work with JPEG images.

 Signature 


Vasiliy

August 10, 2010

Andrey Maslennikov Andrey Maslennikov
Lab Rat
6 posts

sagod, thank you, png works.

Vass, what exactly I should do to use jpeg? Where I can found this plugin?

 Signature 

BR, Andrey

August 10, 2010

Thomas Zander Thomas Zander
Ant Farmer
224 posts

Qt has image plugins which are enabled for compilation when it finds the appropriate system library. In this case libjpeg.

If the loading of the jpeg does not work on that machine then you are missing the jpeg library and if you compiled Qt yourself you may need to recompile Qt. On Linux you need something like libjpeg62-dev. If you are using something else, google for it or tell us what system you have and you may get lucky that someone else is running it that reads this thread :)

August 10, 2010

Andrey Maslennikov Andrey Maslennikov
Lab Rat
6 posts

Oh, recompile… Again… :)
Thank you!

I use Win XP. And as I understand I should configure Qt with -qt-libjpeg key. Do I need something else to get it done?

 Signature 

BR, Andrey

 
  ‹‹ How to get window handle (HWND) of core application window on Win32 for QSpaceNavigator      QEventDispatcherWin32 does not handle WM_INPUT messages properly - BUG? ››

You must log in to post a reply. Not a member yet? Register here!