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 MACRO DEFINE compile-time and coding-time (Read 2550 times)
lorenzo.delana
Newbies
*
Offline


Posts: 4
Joined: Mar 3rd, 2016
MACRO DEFINE compile-time and coding-time
Mar 4th, 2016 at 7:40pm
Print Post  
In a code like the follow

#if DEBUG
...
#endif

I noticed that if I insert the define into the visualmicro project property page for "Extra cpp flags" the compile-time works fine, but the editor still gray out the region.
http://1drv.ms/1Rtj69l

While, if I insert the define using the "Configuration Properties/C_C++/All Options/Additional Options" inserting there a -DDEBUG the edit-time looks good, but the compile-time not consider that additional option.
http://1drv.ms/1pqAeGj

In short to make it work in edit-mode and compile-mode I need to insert the define into the vs configuration properties and in the visual micro project property page too.

Is there another solution to make it work without to insert the same define in two places ?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: MACRO DEFINE compile-time and coding-time
Reply #1 - Mar 12th, 2016 at 2:12pm
Print Post  
Hi,

You can add a semi-colon list to the Visual Micro project property called "Defines". These are included in both intellisense and compile....

DEFINE1;DEFINE2=5;DEFINE3

You can set the Defines property for a specific config or globally for the entire project.

ps: You are right. It was expected that any -D switches in the flags are extracted for intellisense however that doesn't appear to be working at the moment.
  
Back to top
IP Logged
 
lorenzo.delana
Newbies
*
Offline


Posts: 4
Joined: Mar 3rd, 2016
Re: MACRO DEFINE compile-time and coding-time
Reply #2 - Mar 12th, 2016 at 4:12pm
Print Post  
Yes, it worked
thx for the reply.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint