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 Zero/SAMD21 incompatibility (Read 4829 times)
BioEngr
Newbies
*
Offline


Posts: 5
Joined: Dec 21st, 2016
Zero/SAMD21 incompatibility
Dec 21st, 2016 at 4:43pm
Print Post  
When I ported my working code from a Uno to a Zero, Visual Studio marked every Arduino statement in the source .CPP files as an error.  The main .INO file was fine.  Build worked and it ran fine.  I think the problem has to do with #include "WProgram.h" which was flagged.  Apparently it doesn't exist for Zero or a path needs to be fixed.  Verbose build listing is attached if that will help.   

Any ideas will be greatly appreciated.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Zero/SAMD21 incompatibility
Reply #1 - Dec 21st, 2016 at 4:56pm
Print Post  
Hi,

Is the #include wprogram.h within a condition that uses either arduino.h or wprogram.h?

Thanks
  
Back to top
IP Logged
 
BioEngr
Newbies
*
Offline


Posts: 5
Joined: Dec 21st, 2016
Re: Zero/SAMD21 incompatibility
Reply #2 - Dec 21st, 2016 at 6:21pm
Print Post  
Yes, exactly.  It's the boilerplate that gets inserted when I create a new file.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Zero/SAMD21 incompatibility
Reply #3 - Dec 21st, 2016 at 6:40pm
Print Post  
The conditional syntax checks the ARDUINO pre-processor definition version. 

It's the #include "arduino.h" that should be valid

Visual Micro should add the ARDUINO version to the  pre-processor section of the C/C++ project options (right click project name in solution explorer and click properties)

If in doubt please save and zip the .vcxproj file and also the [proj_name].vsarduino.h from the __vm folder below the project

email to info[at]visualmicro.com

If the ARDUINO define is missing this suggests some other intellisense issues will also be encountered but as you say it is unrelated to compile.

fyi:

the wprogram.h is no longer used by all recent arduino hardware. some other vendors still use it but normally you can just #include "arduino.h" and remove the conditional #include of wprogram.h
« Last Edit: Dec 21st, 2016 at 6:41pm by Tim@Visual Micro »  
Back to top
IP Logged
 
BioEngr
Newbies
*
Offline


Posts: 5
Joined: Dec 21st, 2016
Re: Zero/SAMD21 incompatibility
Reply #4 - Dec 21st, 2016 at 7:06pm
Print Post  
Removing the conditional and the #include wprogram.h fixed the problem.  Thank you.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Zero/SAMD21 incompatibility
Reply #5 - Dec 21st, 2016 at 7:54pm
Print Post  
Thanks for the update but it still indicates there is a issue we should look into. The syntax should have worked and shows a problem with an important define.

If possible please zip and email the .vcxproj and vsarduino.h files or attach to a post here. Thanks very much.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint