Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: rebelxt on September 05, 2015, 06:54:20 pm

Title: [Solved] Debug/Release environmental variable
Post by: rebelxt on September 05, 2015, 06:54:20 pm
Is there an environmental variable that can be used in my C++ source program to distinguish between the Debug and Release environments? Or is there a way to define one?

I am using Code::Blocks 13.12 in Linux Mint 17.2.

Thanks for any help.
Title: Re: Debug/Release environmental variable
Post by: scarphin on September 05, 2015, 07:21:18 pm
In usual sense, 'debug' and 'release' are not environments, they are targets. If you want to distinguish 'debug' and 'release' targets for a project, you can insert a target specific define in menu 'project->build options->compiler settings tab->#defines tab', be sure to select the correct target from the tree to the left. Then you can use these defines inside your code. If you're asking for something else please elaborate.
Title: Re: Debug/Release environmental variable
Post by: stahta01 on September 05, 2015, 07:22:20 pm
Your question makes no sense to me.
If, you do NOT get another reply in a few hours; I would suggest posting more information on what you are asking.

One point is by "environmental variable" I have no idea if you mean:
1. CB environmental variable
2. CB custom variable
3. OS environmental variable
4. macro definition

Tim S.
Title: Re: Debug/Release environmental variable
Post by: rebelxt on September 06, 2015, 01:33:33 pm
Apologies for not knowing the proper terminology; I'm pretty much new at this. That being said, scarphin has the answer I need.  Thanks.