Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Frank3000 on December 19, 2005, 01:59:07 pm

Title: How to deliver options to resource compiler ?
Post by: Frank3000 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
Title: Re: How to deliver options to resource compiler ?
Post by: jimp 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.
Title: Re: How to deliver options to resource compiler ?
Post by: thomas 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...
Title: Re: How to deliver options to resource compiler ?
Post by: Frank3000 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
Title: Re: How to deliver options to resource compiler ?
Post by: Frank3000 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
Title: Re: How to deliver options to resource compiler ?
Post by: grv575 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.
Title: Re: How to deliver options to resource compiler ?
Post by: jimp 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++).