VisualC++: Debug / Release?

Programming, for all ages and all languages.
Post Reply
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

VisualC++: Debug / Release?

Post by Solar »

I know it's possible to determine whether my source is compiled with VisualC++ using

Code: Select all

#ifdef _MSC_VER
But is it possible to determine whether Visual is set to compile for Debug or Release?

I could use that for some NDEBUG trickery...
Every good solution is obvious once you've found it.
zloba

Re:VisualC++: Debug / Release?

Post by zloba »

try looking in project settings, it should display compiler commandline switches (under "compiler options" or "C++ options" or somesuch)
i'm sure there is some #define, like DEBUG or some variation of underscores.
(IIRC, based on MSVS 6 i used long ago)
AR

Re:VisualC++: Debug / Release?

Post by AR »

Code: Select all

#ifdef _DEBUG
This is for MSVC++6, I haven't bothered to reinstall MSVC++7 since I last reinstalled Windows, but it should work on that to.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:VisualC++: Debug / Release?

Post by Solar »

Thanks!
Every good solution is obvious once you've found it.
Post Reply