Author Topic: How to deliver options to resource compiler ?  (Read 6576 times)

Offline Frank3000

  • Multiple posting newcomer
  • *
  • Posts: 17
How to deliver options to resource compiler ?
« on: December 19, 2005, 01:59:07 pm »
Hello,
I'm trying to compile the zlib library with codeblocks (rev. 1562).
I need to pass the -DGCC_WINDRES option to windres.exe otherwise I
get a syntax error in zlib1.rc. Where is this possible ?
(except at programs tab direct after windres.exe)

Frank
« Last Edit: December 19, 2005, 02:06:37 pm by Frank3000 »
Klingon multitasking systems do not support 'time-sharing'. When a Klingon program wants to run,
it challenges the scheduler in hand-to-hand combat and owns the machine.

Offline jimp

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: How to deliver options to resource compiler ?
« Reply #1 on: December 21, 2005, 09:02:22 pm »
CodeBlocks has no option to send options to the resource compiler (but probably should).  You can put the option in Compiler Settings, Other, Advanced options, Compile Win32 Resource File,  or  as you said after windres.exe.  Doing this will send it to all programs compiled with the resource compiler.

What does GCC need that other resource compilers don't?  Resource files don't usually contain options that are compiler specific.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: How to deliver options to resource compiler ?
« Reply #2 on: December 21, 2005, 10:01:50 pm »
Hmm... not implemented, sorry.

But, does the resource compiler not support #include?
I think it does... Then you could #include "foo.h" and put #define GCC_WINDRES in there...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Frank3000

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: How to deliver options to resource compiler ?
« Reply #3 on: December 21, 2005, 10:16:25 pm »
Thx for your answer.

Resource files don't usually contain options that are compiler specific.

Yes, I haven't seen that before either.

Quote
#ifdef GCC_WINDRES
VS_VERSION_INFO      VERSIONINFO
#else
VS_VERSION_INFO      VERSIONINFO   MOVEABLE IMPURE LOADONCALL DISCARDABLE
#endif
Klingon multitasking systems do not support 'time-sharing'. When a Klingon program wants to run,
it challenges the scheduler in hand-to-hand combat and owns the machine.

Offline Frank3000

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: How to deliver options to resource compiler ?
« Reply #4 on: December 21, 2005, 10:19:29 pm »
Hmm... not implemented, sorry.

But, does the resource compiler not support #include?
I think it does... Then you could #include "foo.h" and put #define GCC_WINDRES in there...

O.k. but if I wanted to change the source file I could just remove the #if part.
 :D
Klingon multitasking systems do not support 'time-sharing'. When a Klingon program wants to run,
it challenges the scheduler in hand-to-hand combat and owns the machine.

grv575

  • Guest
Re: How to deliver options to resource compiler ?
« Reply #5 on: December 22, 2005, 02:05:54 am »
The #defines tab is the proper place to define preprocessor flags (-Dflag), regardless of the tool which handles preprocessing (gcc or windres).  I don't see why putting GCC_WINDRES here wouldn't not be the right thing to do, as other stages shouldn't be checking for that flag anyway.

Offline jimp

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: How to deliver options to resource compiler ?
« Reply #6 on: December 22, 2005, 06:48:17 pm »
The #defines tab is the proper place to define preprocessor flags (-Dflag), regardless of the tool which handles preprocessing (gcc or windres).

Options in the #defines tab are not passed to the resource compiler(windres).  They are passed only to the source code compiler(g++).