In Windows, using mingw's gcc, is there anyway to specify that the output exe file is to take an icon file, so that the exe file shows with that icon in explorer?
相关问题
- Inheritance impossible in Windows Runtime Componen
- how to get running process information in java?
- Is TWebBrowser dependant on IE version?
- How can I have a python script safely exit itself?
- I want to trace logs using a Macro multi parameter
相关文章
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Warning : HTML 1300 Navigation occured?
- Bundling the Windows Mono runtime with an applicat
- Windows 8.1 How to fix this obsolete code?
- gcc/g++ gives me error “CreateProcess: No such fil
- Calls that precede a function's definition can
- How can I use gcc's -I command to add recursiv
You need to create the icon first. Then you need to create a RC file with the below content. Here we'll name it as
my.rc
.The
id
mentioned in the above command can be pretty much anything. It doesn't matter unless you want to refer to it in your code. Then run windres as follows:Then while building the executable, along with other object files and resource files, include
my.res
which we got from the above step. e.g.:And that should be all there is to it.
And, at no extra charge, if you want to include version information in your application, add the following boilerplate to a new
.rc
file and follow the above mentioned steps.Note, the langID is for U.K. English (which is the closest localisation to Australia I could identify.) If you want U.S. "English" then change the
BLOCK
line to:and the translation line to:
See VERSIONINFO resource for for info.
Try Resource Hacker. I was able to cross compile my project in Linux (WSL) and generate an icon from the logo on the homepage. Just needed a simple way to embed it in the exe and this program worked great. Resource Hacker by Angus Johnson
In the RC file, the nameID does not even have to be a name, it can just be an integer. The filename must be quoted only if it contains a space. Instead of:
You can use:
ICON resource
windres man page
Example