Author Topic: MinGW windres.exe - How to set compiler flags  (Read 13171 times)

Offline PC_Nerd

  • Multiple posting newcomer
  • *
  • Posts: 12
MinGW windres.exe - How to set compiler flags
« on: February 13, 2010, 02:43:26 am »
Hi,

I've run into the same error as http://forums.codeblocks.org/index.php?topic=11573.0 and I've checked that there doesnt seem to be any define for GCC_WINDRES, so I want to add one on command line...   I've managed to set a define for all build calls, through the "build options -> Compiler Settings ->#defines" window, however I cannot see that it is added to the windres call:

Quote
mingw32-gcc.exe  -g -W -O0 -DWIN32 -D_DEBUG -DGCC_WINDRES    -IC:\ba_jack_branch.old\Dependencies\include\  -c C:\ogre17\Dependencies\src\zlib-1.2.3\zutil.c -o Win32_LIB_Debug\zutil.o
windres.exe: C:\\ogre17\\DEPEND~1\\src\\ZLIB-1~1.3\\win32\\zlib1.rc:6: syntax error
Process terminated with status 1 (0 minutes, 1 seconds)
1 errors, 0 warnings

I've enabled ( as you can see) the full cmd output, and I cannot see the call to windres, only its erroneous output.

Thanks for any help you can offer.
PC_Nerd

Edited: Corrected quoted compiler output.

Offline PC_Nerd

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: MinGW windres.exe - How to set compiler flags
« Reply #1 on: February 13, 2010, 02:54:01 am »
Update:

Of course as soon as I post and continue searching...  I tinkered a little with the advanced compiler setting, and I added an explicit -DGCC_WINDRES to the resource compiler...   that compiles fine.

So I guess the question now is, how can I do this without changing ALL calls to windres, but only within my project ?

Thanks,
PC_Nerd

Offline AndyJ

  • Multiple posting newcomer
  • *
  • Posts: 24
Re: MinGW windres.exe - How to set compiler flags
« Reply #2 on: January 21, 2011, 07:48:13 pm »
Sorry to revive an old thread, but I now have exactly the same problem - how can I add a project specific define to the resource compiler command line?

I tried adding this directly to the project file:

      <ResourceCompiler>
         <Add option="-DBUILD_SPECIAL_VERSION" />
         <Add directory="$(#wx)\include" />
         <Add directory="Src" />
      </ResourceCompiler>

but it doesn't seem to work?

Thanks for any help,

Andy

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7590
    • My Best Post
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