Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: william.chen on November 03, 2009, 07:50:06 am

Title: can't compile resource with windres
Post by: william.chen on November 03, 2009, 07:50:06 am
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.
Title: Re: can't compile resource with windres
Post by: MortenMacFly on November 03, 2009, 08:56:28 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.
Title: Re: can't compile resource with windres
Post by: 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.
Title: Re: can't compile resource with windres
Post by: stahta01 on November 04, 2009, 03:31:31 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.