Resource compiler and configuration

Resource compiler and configuration


Is it possible to identify, in a resource script file, which configuration is currently being built (Win32, x64,...) ?

Is there an internal variable or constant that can be used for this purpose ?
I would like to use different resources depending on the configuration.


4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

You can use typical C-style conditional compilation directives, such as #ifdef, in a resource script. It doesn't appear that VS adds any /d options to the rc command line for configuration name, but you can right click on the resource file in the project, select Properties, and add a predefined macro name of your own. This is per-configuration, so you can have DEBUG in one and RELEASE in the other. Then you cn use #ifdef to control things.

Retired 12/31/2016

Hi steve,
Thanks for the information.
I have tried and it works well. However I would like to know if the compiler creates internal variables that could be directly used inside the resource script to avoid the need to manually add them in the build settings of the .rc file (mainly to identify the target plaftorm Win32 or x64).

Best regards,

The resource compiler is a Microsoft tool - Visual Studio does not, on its own, pass predefined identifiers to the RC step.

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today