Where did you place project.qrc?
It's all in the same project folder. No subdirectories are used to store the project's files.
Have youd had your resource file to the *.pro file of your project?
Qt Code:
RESOURCES = myresource.qrcTo copy to clipboard, switch view to plain text mode
If I don't add the *.qrc file to the *.pro it will compile properly. If I add the resource it will throw an error saying this file does not exist.
On a side note, I'm using QT SDK and if I build for debugging it will compile properly and run the program with the resource included in the project file.
Thanks again.
Please show us the code where you use data from the resource file and paste the contents of your qmake project file.
Sure. I'm currently just trying to compile an example from the book C++ GUI Programming with Qt4, 2nd Edition.
iconeditor.qrc
Qt Code:
<RCC> <qresource> <file>images/mouse.png</file> </qresource> </RCC>To copy to clipboard, switch view to plain text mode
iconeditor.pro
Qt Code:
TEMPLATE = app HEADERS = iconeditor.h SOURCES = iconeditor.cpp \ main.cpp RESOURCES = iconeditor.qrcTo copy to clipboard, switch view to plain text mode
I meant the code where you are using the data from the resource file.
Doh! I meant to post that.. Sorry.
It's in the main.cpp.
Qt Code:
To copy to clipboard, switch view to plain text mode
Looks fine. What happens if you manually run rcc.exe on the qrc file?
I'm not certain how to do that? Currently I am at work so I can't do it till later this afternoon.
Open the Qt command prompt, cd to the directory where the qrc file is and run rcc.exe iconeditor.qrc
goodz (20th March 2010)
Alright I got it to compile using the qmake; I didn't realize I was doing it wrong. Apologies.
However, it doesn't build an executable. Am I still doing something wrong?
Bookmarks