Author Topic: can't compile resource with windres  (Read 4754 times)

william.chen

  • Guest
can't compile resource with windres
« 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: can't compile resource with windres
« Reply #1 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

william.chen

  • Guest
Re: can't compile resource with windres
« Reply #2 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: can't compile resource with windres
« Reply #3 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org