Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic if #ifdef _DEBUG working? (Read 7436 times)
Massimo S
Junior Member
**
Offline


Posts: 13
Joined: Aug 13th, 2015
if #ifdef _DEBUG working?
Sep 3rd, 2015 at 7:27pm
Print Post  
On VisualStudio I added a log library and all log statement should be under #ifdef but it appears they are ignored.
Is it working? am I doing something wrong?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: if #ifdef _DEBUG working?
Reply #1 - Sep 3rd, 2015 at 9:03pm
Print Post  
Hi,

If you search visualmicro.com or the forum for _debug you should get a few hits.

The VS project properties are not used. You can achiever the same thing using the _debug constant available in the VM project properties.

http://www.visualmicro.com/search.aspx?q=_debug

  
Back to top
WWW  
IP Logged
 
Massimo S
Junior Member
**
Offline


Posts: 13
Joined: Aug 13th, 2015
Re: if #ifdef _DEBUG working?
Reply #2 - Sep 3rd, 2015 at 9:43pm
Print Post  
ops! sorry for my dummyness and thank you!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: if #ifdef _DEBUG working?
Reply #3 - Sep 3rd, 2015 at 9:49pm
Print Post  
No problem. Hopefully an "advanced"option is coming soon that will allow more control using standard vs project and solution config.
« Last Edit: Sep 3rd, 2015 at 9:49pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Massimo S
Junior Member
**
Offline


Posts: 13
Joined: Aug 13th, 2015
Re: if #ifdef _DEBUG working?
Reply #4 - Sep 3rd, 2015 at 10:30pm
Print Post  
This is great Smiley

But I'm confused...
I've read a lot of pages and I did the project properties Define _DEBUG constant 1
Then I changed the code in:
#if !defined(VM_DEBUG)

as written in docs but when I change from Debug to Release the code does not gray out and the memory footprint is the same.

What am I doing wrong?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: if #ifdef _DEBUG working?
Reply #5 - Sep 3rd, 2015 at 10:35pm
Print Post  
The _DEBUG constant is per configuration. It's shown in the wrong section of the properties so this is not clear.

eg: You can have one settings for Release and one for Debug.
« Last Edit: Sep 3rd, 2015 at 10:35pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint