LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to detect compiling for debug or release

Hello,
 
is there some way to automatically mark out certain lines in my code when compiling to create a release executable. In my preprocessor file, I have a definition:
 #define DEBUG_NO_RS232.
It is used to simulate RS232 communication when debugging my code. I want to make sure that this definition is disabled when creating a release executable, so I need something like this:
 
#ifndef CREATING_RELEASE_EXECUTABLE
#define DEBUG_NO_RS232
#endif
 
Here CREATING_RELEASE_EXECUTABLE should automatically be defined when Build Configuration is set to Release.
 
All hints are appreciated,
Wim
 
0 Kudos
Message 1 of 5
(3,826 Views)
CVI IDE defines a _CVI_DEBUG_ macro if the Buid configuration is seto to Debug.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 5
(3,825 Views)

Thanks Roberto,

This will save me a lot of complaints (Once I forgot to mark out the #define DEBUG_NO_RS232 line when creating a customer distribution kit Smiley Wink )

0 Kudos
Message 3 of 5
(3,822 Views)
Not at all! I was formerly using BeingDebuggedByCVI () function but it hasn't the same meaning and usage, next sombody here on the forum spoke about that macro... Your starts should really go to that person but I don't remember who was he.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 5
(3,817 Views)

Roberto,

I think you are referring to this thread http://forums.ni.com/ni/board/message?board.id=180&message.id=23261&requireLogin=False
You earned the stars by answering in this one. 

Message 5 of 5
(3,808 Views)