Rcc: File does not exist



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



  • Could you provide more info? Such as your .pro



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



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



  • [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/.



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


  • 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?



  • 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'@



  • [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.



  • 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



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.