News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

can't compile resource with windres

Started by william.chen, November 03, 2009, 07:50:06 AM

Previous topic - Next topic

william.chen

Hi,

I use codeblocks to compile icon resource to add icon for exectuable file.
The resources.rc file content is:
MAINICON  ICON  "mainico.ico"

I add resources.rc file and mainico.ico file into codeblocks project, then build, the build log window shows error as below:
[ 66.7%] windres.exe -i C:\william\Program\CODEBL~1\TRUESE~2\rc\RESOUR~1.RC -J rc -o obj\Release\rc\resources.res -O coff -IC:\MinGW\wxWidgets-2.8.10\include -IC:\MinGW\wxWidgets-2.8.10\lib\gcc_lib\mswu
windres.exe: preprocessing failed.
Process terminated with status 1 (0 minutes, 5 seconds)
1 errors, 0 warnings

It is pretty strange that no more detail error information but just "preprocessing failed".  So i look for some help here if anybody knows the reason? Thanks a lot.

The windres version i am using:
GNU windres (GNU Binutils) 2.20
Copyright 2009 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.

MortenMacFly

Quote from: william.chen on November 03, 2009, 07:50:06 AM
GNU windres (GNU Binutils) 2.20

Where do you got that from? The latest binutils I know are 2.19.1. Probably that's the reason. Please use an "official" compiler framwork, e.g. from MinGW.org or TDM's GCC.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

william.chen

Hi MortenMacFly,

Thanks for your input.
The version 2.20 comes from my reinstallation of MinGW-5.1.4 yesterday. The installer informed me new version components available, so I just upgraded. I can't remember the old version number before that, but there was a "copyright 2007" in my impression. Acutally, the preprocessing failed error alreay exists 4 months ago.

stahta01

Quote from: william.chen on November 04, 2009, 02:30:39 AM
Hi MortenMacFly,

Thanks for your input.
The version 2.20 comes from my reinstallation of MinGW-5.1.4 yesterday. The installer informed me new version components available, so I just upgraded. I can't remember the old version number before that, but there was a "copyright 2007" in my impression. Acutally, the preprocessing failed error alreay exists 4 months ago.

FYI:

Some version of windres do NOT work with spaces or special characters.

Note: This is a problem that is fixed and broken often in windres.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]