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. [SOLVED]problem with resources: file not found
QtWS25 Last Chance

[SOLVED]problem with resources: file not found

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 21.0k 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.
  • F Offline
    F Offline
    fluca1978
    wrote on last edited by
    #1

    Hi all,
    I want to compile a set of icons as resources into my qt application. To do this I've placed the following into the project file:

    @RESOURCES +=
    whr.qrc@

    and the whr.qrc file is the following:

    @<RCC>
    <qresource>
    <file>img/quit.png</file>
    <file>img/database.png</file>
    <file>img/qt.png</file>
    <file>img/about.png</file>
    </qresource>
    <RCC/>@

    and the img directory is at the same level of the project and qrc file (within my project folder).
    When I try to clean-compile the project inside the qdeveloper ide I got the following error:

    @make: *** [qrc_whr.cpp] Error 1
    The process "/usr/bin/make" exited with code 2.
    Error while building project WHR (target: Desktop)
    When executing build step 'Make'@

    What am I missing here?

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      maybe because you don't have a prefix like this :

      @<RCC>
      <qresource prefix="/">
      <file>books4132-1.png</file>
      </qresource>
      </RCC>@

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fluca1978
        wrote on last edited by
        #3

        Uhm..it maybe, but I think the problem is another.
        After having restarted the qtcreator I can see the qrc file listed under the resources, but when I double click on it an error dialog appears saying that it is impossible to open the file:

        @Cannot open file /sviluppo/c/WHR/whr.qrc!@

        but on the filesystem the file seems to be in the right place:

        @$ ls -l *.qrc
        -rw-r--r-- 1 luca luca 149 2011-09-26 14:26 whr.qrc@

        I am using qt creator 2.2.1. Any idea?

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fluca1978
          wrote on last edited by
          #4

          I have removed the file and recreated it with the resource editor. The only difference I see when viewed as a text file with the previous one is about spacing...not sure what the problem was but is fixed now.

          @<RCC>
          <qresource prefix="/">
          <file>img/about.png</file>
          <file>img/database.png</file>
          <file>img/qt.png</file>
          <file>img/quit.png</file>
          </qresource>
          </RCC>
          @

          1 Reply Last reply
          0
          • F Offline
            F Offline
            fluca1978
            wrote on last edited by
            #5

            Just to add a quick note: after a reboot of the qtcreator the problem happened again. It seems the resource file is kept into cache, since it was pointing to wrong resource files. Even a clean all did not solved the problem. The only solution was to manually run qmake from the build menu.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              gbhat
              wrote on last edited by
              #6

              Same issue with demo compilations windows in mingw compilation. Checked syntax's and declarations right, gives an qrc_xyz.cpp "file not found error" when compiling xyz.qrc in the same directory for .png files.

              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