PDA

View Full Version : How to link windows .res file



spatten
25th August 2011, 13:22
I am using Qt 4.7.3 with Qt Creator 2.2.1 and building an application for Windows desktop.
I am wanting to create a windows resource and have created a .rc file, run the rc compiler and generated the .res file.
My question is, how do I link my application to the .res file?
Do I need to specify this in the .pro file and if so how?
Or is there something I need to do in the project settings?
I have tried searching but couldn't find anything.

Thanks.

cincirin
25th August 2011, 13:46
see RC_FILE qmake variable (http://doc.qt.nokia.com/latest/qmake-variable-reference.html#rc-file)

spatten
25th August 2011, 14:11
Thanks, I have got it working.
I had seen the RC_FILE variable in the searches I did, however it was not clear to me whether I should use it with the .rc file or the .res file and when I tried it, neither worked.
It turns out you should use the .rc file and that you do not need to add custom build steps to call the rc compiler. In my inexperience my problem was that I was not adding the correct path to my .rc file.
So I had RC_FILE = MyApp.rc and the error I got was that there was no rule to make the .rc file. When I now tried it with RC_FILE = ../Source/MyApp.rc it works.