When I select the "Debug" configuration, the DEBUG
constant is active. When I select the "Release" configuration, the DEBUG
constant is inactive.
How can I create my own configurations so that they include my own defined constants. Basically, I want it so that if I select the configuration "FOOBAR" that there is a constant FOO
and BAR
in my project active.
I'm basically trying to avoid putting in a bunch of #define FOO
in my projects, then commenting/uncommenting them out when I need/don't need them.
In the Configuration drop-down list for that project, choose New. The New Project Configuration dialog box opens. In the Name box, enter a name for the new configuration. To use the property settings from an existing project configuration, in the Copy settings from drop-down list, choose a configuration.
The project configuration determines what build settings and compiler options are used when you build the project. To create, select, modify, or delete a configuration, you can use the Configuration Manager. To open it, on the menu bar, choose Build > Configuration Manager, or just type Configuration in the search box.
In Solution Explorer, right-click the project and choose Properties. In the side pane, choose Build (or Compile in Visual Basic). In the Configuration list at the top, choose Debug or Release. Select the Advanced button (or the Advanced Compile Options button in Visual Basic).
Click TOOLS > SETTINGS > check EXPERT SETTINGS to see the build configuration manager (This is only applicable to Visual Studio 2010 Express Edition and NOT for 2008 Express Edition) Click BUILD > CONFIGURATION MANAGER select the platform dropdown to X86 and click CLOSE.
According to this article you can define compilation constants in the build tab of your project properties.
EDITED: To define build configurations you can go to Build > Configuration manager and I think you can define compilation constants there too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With