Creating binary external resource file in Qt

1.7k views Asked by At

I need to create binary external resource file due to the fact that I'm working with multiple large images. I tried to create it from the commandline in Qt Creator as stated in the documentation (with rcc -binary image.qrc -o image.rcc command, where image.qrc is my already created .qrc file, also located in the working directory), but so far without a luck.

If I understand correctly, running application with this command should generate image.rcc file in the working directory, right? Currently, when I run my application, it starts but file isn't created anywhere. There is no error, no nothing. I would appreciciate anyones help, because I run out of ideas.

I use Qt 5.8 and MinGW 32bit compiler (but tried it also with MSVC2010 32bit and Qt 5.4.2 and still without success).

EDIT: My qrc file (I reduced the number of files just for the tests).

<RCC>
    <qresource prefix="/">
        <file>images/dm.png</file>
        <file>images/mountains_op.png</file>
    </qresource>
</RCC>
1

There are 1 answers

0
Vex On

I found a solution (mostly thanks to @eyllanesc comment). I needed to change the directory in the command line to the one where rcc.exe is located. I kept trying to run: rcc -binary image.qrc -o image.rcc from the working directory of my project and not from the directory of Qt, where rcc.exe actually is.