简体   繁体   中英

How to use a .rc file?

I haven't used a .rc file yet. I was looking for how to set the filename/version/product name etc of a Qt assembly file, found this . I created an empty file named resources.rc and the version.h header and added in the .pro file RC_FILE = resources.rc . But when I went to build the application I get this error:

gcc: error: Message\: No such file or directory
gcc: error: Kernel: No such file or directory
windres: preprocessing failed.
Makefile.Release:158: recipe for target 'release/resources_res.o' failed
mingw32-make[1]: *** [release/resources_res.o] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/jack/Desktop/foo/build-Message Kernel-Desktop_Qt_5_5_0_MinGW_32bit-Release'
mingw32-make: *** [release] Error 2
makefile:34: recipe for target 'release' failed
00:43:58: The process "C:\Qt2\Qt5.5.0\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project Message Kernel (kit: Desktop Qt 5.5.0 MinGW 32bit)
When executing step "Make"

How do I fix this?

Found the error! Hope this is useful to anyone!

My project name contains white spaces, by looking carefully at compiler output tab (in Qt creator) I noticied that the path passed to windres utility wasn't surrounded by quotes (as a path with spaces in name should be) causing the error:

gcc: error: Message: No such file or directory

So I just removed the spaces from project name and this worked just fine.

Here's the Qt version this is happening:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM