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 (ARDUINO >= 100) works in .h but not .cpp. (Read 3639 times)
Robert Mann
Newbies
*
Offline


Posts: 2
Location: Bakersfield, CA
Joined: Feb 10th, 2012
#if (ARDUINO >= 100) works in .h but not .cpp.
Oct 18th, 2015 at 11:22am
Print Post  
So let me try to explain this.  I have this statement in my class files .h In Visual Studio it grays out the the 

#include <WProgram.h> 

line so I can tell it will use the #include <Arduino.h> line.

Code (C++)
Select All
#if (ARDUINO >= 100)
# include <Arduino.h>
#else
# include <WProgram.h>
#endif
 



But that same code in my classes .cpp file grays out the

#include <Arduino.h>

line and shows that it will use the #include <WProgram.h> instead.

I have also noticed that Intellisense does not work in my .cpp files but works fine in my .h files.

Am I missing a setting someplace?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: #if (ARDUINO >= 100) works in .h but not .cpp.
Reply #1 - Oct 18th, 2015 at 1:53pm
Print Post  
Hi,

It sounds like VS doesn't think the cpp is part of the project. 

I just added a cpp/h file to a project and the code correctly shows the disabled state.

How did you create the cpp?
How did you open it?

If you don't see an obvious solution then please zip and email the sketch to info [at] visualmicro.com

Thanks
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint