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 [SOLVED] VS2013 - Intellisense false errors (Read 9178 times)
Lexu
Newbies
*
Offline


Posts: 4
Location: Romania
Joined: Feb 19th, 2014
[SOLVED] VS2013 - Intellisense false errors
Feb 19th, 2014 at 1:21am
Print Post  
Hi there,

I've been starting to use VM for my bachelor degree project, everything is working as intended but, intellisense is a bit of a fail on me, with over 100 errors in _CORE related headers and some weird other errors in my code.

I'm using VS2013, VM 1401.26, Code compiles and uploads just fine.

Example of intellisense fails:

Code
Select All
const int pin_input = A0;
// error: expression must have a constant value 



Code
Select All
extern "C"{ }
// error: expected an identifier 



And some other errors related to the struct i used inside the extern "C".

I mention again that the code compiles and uploads just fine, but the intellisense errors are a little annoying.

Thanks in advance for any help! Smiley

EDIT:
The fix for my problem can be found here:

Code
Select All
Project -> References -> Configuration properties -> C/C++ -> Advanced -> Compile as -> Compile as C++ code (/TP);
 

« Last Edit: Feb 19th, 2014 at 10:12pm by Lexu »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VS2013 - Intellisense false errors
Reply #1 - Feb 19th, 2014 at 1:51am
Print Post  
Hi,

Thanks for the overview.

The compile is managed by Visual Micro and ensures the same result as the Arduino Ide.

The intellisense is managed by each Ide, Visual Micro simply feeds it some includes, paths and pre-processor defs.

Visual Studio C++ is not entirely compatible with Arduino and often we suggest closing the errors list and using the compiler dbl click drill down into error or the red squiggles to see errors. That said normally we would expect less than 20 false errors but it does depend on the code and it hasn't been tested with c code very much. You are welcome to email your sketch to info [at] visualmicro.com. There are some things we can do to tweak the intellisense so having your sketch might prompt some questions/discussion.

Another alternative that might be better is Atmel Studio which is free and is VS 2010. It's intellisense engine expects gcc so might work better for you.
  
Back to top
IP Logged
 
Lexu
Newbies
*
Offline


Posts: 4
Location: Romania
Joined: Feb 19th, 2014
Re: VS2013 - Intellisense false errors
Reply #2 - Feb 19th, 2014 at 11:39am
Print Post  
Hi there,

I've tried Atmel studio before trying VS2013, i just like having less IDE's in my PC and i have recieved VS2013 free from my University.

Well, i guess i'll get used to it, i disabled intellisense errors and switched to output tab, now i see only the compiler related errors when happening.

It's just that i like to write C code, so i needed extern "C" in my header, and lot's of errors, including extern "C" appeared.

Thanks for the fast feedback!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VS2013 - Intellisense false errors
Reply #3 - Feb 19th, 2014 at 1:42pm
Print Post  
If you find time to edit the vsarduino.h in the visual micro folder maybe you can cause less errors to appear. 

NB: The .h file is re-written when you compile, switch board and perform various other tasks so your changes will quickly be lost

If you find any combination in the cpp project settings or vsarduino.h that improves the situation please do let me know so we can extend Visual Micro

Thanks very much

vsarduino.h and proj settings are not used in the compile. We can hack them purely to improve intellisense
« Last Edit: Feb 19th, 2014 at 1:43pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Lexu
Newbies
*
Offline


Posts: 4
Location: Romania
Joined: Feb 19th, 2014
Re: VS2013 - Intellisense false errors
Reply #4 - Feb 19th, 2014 at 9:29pm
Print Post  
Hi there,

I managed to resolve my mentioned problems regarding intellisense errors and extern "C" thingy.

My fix:
Project -> References -> Configuration properties -> C/C++ -> Advanced -> Compile as -> Compile as C++ code (/TP);

Hope this helps! Smiley
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: [SOLVED] VS2013 - Intellisense false errors
Reply #5 - Feb 19th, 2014 at 10:21pm
Print Post  
Yes that's fantastic thanks. Do you think it makes sense for Visual Micro to always switch the property on for Arduino projects?
  
Back to top
IP Logged
 
Lexu
Newbies
*
Offline


Posts: 4
Location: Romania
Joined: Feb 19th, 2014
Re: [SOLVED] VS2013 - Intellisense false errors
Reply #6 - Feb 19th, 2014 at 10:33pm
Print Post  
Yes, i think it makes perfect sense to switch it on by default.

Judging by the fact that Arduino projects are both C and C++ and compilation is handled by the Arduino libs, i see no downside in doing this. For now, all my intellisense problems are gone.

I still got some intellisense errors from _core folder, but at least my code is fine.

If i get on some problems that could be related to this setting, i will probably report it here.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: [SOLVED] VS2013 - Intellisense false errors
Reply #7 - Feb 19th, 2014 at 10:52pm
Print Post  
Thanks that will be appreciated, good luck with your work
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint