Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Rcc: File does not exist

    General and Desktop
    3
    12
    15901
    Loading More Posts
    • 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.
    • L
      lyuts last edited by

      Hi, guys.
      I'm facing a rather interesting behavior of rcc. I was building one of the projects in a build directory outside the source directory. I ran:
      @$ mkdir proj
      $ cd proj
      $ qmake /path/to/source/dir/proj.pro
      $ make@

      I got the following message during the compilation of resources:

      @/usr/local/qt-4.7.0/bin/rcc: File does not exist '/path/to/project/file.qrc'@

      The first thought that I had (as expected) that the path to qrc file was not valid as relatively to build dir. But what confused me is that the binary has been compiled successfully and all the resources are successfully found at runtime, i.e. I can see all my icons when I run this application.

      Besides that, running the next command is proving that rcc is looking at the right place because it ls finds the resource file by the path reported by rcc.

      @$ ls /path/to/project/file.qrc@

      Note: When specifying the path to icons I use the notation appropriate for resource paths as described in qt docs.

      Does anybody know what really happens here and why the error reported?

      Thanks.

      I'm a rebel in the S.D.G.

      1 Reply Last reply Reply Quote 0
      • D
        danilocesar last edited by

        Could you provide more info? Such as your .pro

        <a href="http://www.danilocesar.com">Danilo Cesar Lemes de Paula</a>
        Software Engineer

        1 Reply Last reply Reply Quote 0
        • L
          lyuts last edited by

          Sorry, I should have pasted it earlier. Here it is:

          @TEMPLATE = app
          TARGET = MyApp

          QT += phonon

          DEPENDPATH += . ui
          INCLUDEPATH += . src

          MOC_DIR = .moc
          OBJECTS_DIR = .obj
          UI_DIR = .uic
          UI_HEADERS_DIR = ui

          Input

          FORMS += ui/MainDialog.ui

          SOURCES += src/main.cpp
          src/MainDialog.cpp

          HEADERS += src/MainDialog.h

          RESOURCES += MyApp.qrc@

          I'm a rebel in the S.D.G.

          1 Reply Last reply Reply Quote 0
          • S
            stukdev last edited by

            Have you try to use this?
            @
            RESOURCES += src/MyApp.qrc
            @

            1 Reply Last reply Reply Quote 0
            • L
              lyuts last edited by

              [quote author="stuk" date="1287413512"]Have you try to use this?
              @
              RESOURCES += src/MyApp.qrc
              @[/quote]

              MyApp.qrc is not in src directory, but on the same level as src/.

              I'm a rebel in the S.D.G.

              1 Reply Last reply Reply Quote 0
              • S
                stukdev last edited by

                Interesting, are you sure that the build of qrc is really build? For example have you try to run a make clean? After the qrc is build correctly?

                1 Reply Last reply Reply Quote 0
                • L
                  lyuts last edited by

                  [quote author="stuk" date="1287414185"]Interesting, are you sure that the build of qrc is really build? For example have you try to run a make clean? After the qrc is build correctly?[/quote]

                  Are you asking if I'm sure that qrc has been successfully compiled? If yes, then yes, I'm sure.

                  1. I have done lots of clean builds/rebuilds
                  2. When running make I see
                    @/usr/local/qt-4.7.0/bin/rcc -name MyApp /path/to/MyApp/MyApp.qrc -o qrc_MyApp.cpp@
                  3. I run this application and all icons which are inside that resource are here.

                  I'm a rebel in the S.D.G.

                  1 Reply Last reply Reply Quote 0
                  • ?
                    Guest last edited by

                    a wild guess here... :)
                    Could it be related to one specific resource file that the code is calling, but does not exist in the resource file or the path in the code is wrong for this file?

                    1 Reply Last reply Reply Quote 0
                    • S
                      stukdev last edited by

                      bq. a wild guess here… :)
                      Could it be related to one specific resource file that the code is calling, but does not exist in the resource file or the path in the code is wrong for this file?

                      In windows this not build the program
                      @RCC: Error in '..\testKeyEvent\test.qrc': Cannot find file 'test.txt'@

                      1 Reply Last reply Reply Quote 0
                      • L
                        lyuts last edited by

                        [quote author="chetankjain" date="1287415200"]a wild guess here... :)
                        Could it be related to one specific resource file that the code is calling, but does not exist in the resource file or the path in the code is wrong for this file?[/quote]

                        When I came across such behavior I thought about wrong paths, so I checked them. For example, here is how I use the the icon from resource:

                        @QIcon(":/img/logo.png")@

                        As far as I understood the qt docs, this is how I should reference the files in my resource.

                        UPD: chetankjain, I think I misunderstood your post. My apologies.

                        I'm a rebel in the S.D.G.

                        1 Reply Last reply Reply Quote 0
                        • ?
                          Guest last edited by

                          ok just tried my suggestion, and there is no warning message too

                          e.g.: My qrc file has 1.jpg, and in code I refer to 2.jpg

                          forgive my interruption, like I said it was a wild guess :p

                          1 Reply Last reply Reply Quote 0
                          • S
                            stukdev last edited by

                            bq. ok just tried my suggestion, and there is no warning message too
                            e.g.: My qrc file has 1.jpg, and in code I refer to 2.jpg
                            forgive my interruption, like I said it was a wild guess :p

                            Ok, i think you tell error in syntax in .qrc not in a code :) In this case yes, no warning :) But i thinks is normal not check if the files exist or not, it assume QString is a valid files :)

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post