Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem with link resources to executable file
Forum Update on Monday, May 27th 2025

Problem with link resources to executable file

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 4.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amaslenn
    wrote on last edited by
    #1

    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:
    @RESOURCES = ./resources/resources.qrc@
    In main.cpp file I do follow:
    @int main(int argc, char *argv[])
    {
    Q_INIT_RESOURCE(resources);
    QApplication app(argc, argv);
    ...
    QSplashScreen splash(QPixmap(":/images/splash.jpg"));
    ...@

    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
    @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.

    BR, Andrey

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sagod
      wrote on last edited by
      #2

      Hi, Andrew.

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

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vsorokin
        wrote on last edited by
        #3

        Hi Andrey.

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

        --
        Vasiliy

        1 Reply Last reply
        0
        • A Offline
          A Offline
          amaslenn
          wrote on last edited by
          #4

          sagod, thank you, png works.

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

          BR, Andrey

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tzander
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0
            • A Offline
              A Offline
              amaslenn
              wrote on last edited by
              #6

              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?

              BR, Andrey

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved