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
Hot Topic (More than 8 Replies) IntelliSense: identifier "xxx" is undefined and some other errors (Read 15360 times)
HofiX-CZ
Newbies
*
Offline


Posts: 8
Joined: Apr 24th, 2016
IntelliSense: identifier "xxx" is undefined and some other errors
Apr 24th, 2016 at 1:31pm
Print Post  
Hello, I haveĀ  problem with IntelliSense in VisualStudio.

It shows me 78 Errors and underlines text in the code. However the code is compilable without compiler errors. The PrintScreen is attached.

The error list can be toggled to "Build only" so the messages don't take space in error list but the underlines persist.

Can you please give me a advice how to remove this behavior? (If it's possible... Smiley )

I'm using Visual Studio Community 2015 with Visual Micro version: 1604.18.0
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
HofiX-CZ
Newbies
*
Offline


Posts: 8
Joined: Apr 24th, 2016
Re: IntelliSense: identifier "xxx" is undefined and some other errors
Reply #1 - Apr 24th, 2016 at 7:06pm
Print Post  
This thread: http://www.visualmicro.com/forums/YaBB.pl?num=1342690682 may be related to the problem but I updated Visual Micro to the latest version via menu in Visual Studio (Tools>Extensions and Updates...>) and it didn't resolved it.

I recently switched from Atmel Studio to Visual Studio and the problem appeared. There was nothing like that in Atmel Studio...
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: IntelliSense: identifier "xxx" is undefined and some other errors
Reply #2 - Apr 24th, 2016 at 7:30pm
Print Post  
Hi,

Sorry for the delay. 

The different Visual Studio versions have handled intellisense in different ways and it looks like the sam/due definitions should be reviewed.

Q: Can you provide a sketch for testing and I can take a look at it?

info ..

Atmel studio is slightly better for gcc intellisense, some of the reason is that it ignores more things that it doesn't understand than Vs. Microsoft are also working on adding better support for gcc instead of normal vc++.

Hopefully we can make a big improvement but if the issues persists and atmel fix a few things there will certainly be updated atmel studio versions again.
« Last Edit: Apr 24th, 2016 at 7:30pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
HofiX-CZ
Newbies
*
Offline


Posts: 8
Joined: Apr 24th, 2016
Re: IntelliSense: identifier "xxx" is undefined and some other errors
Reply #3 - Apr 25th, 2016 at 5:36pm
Print Post  
Sure!

Here is some code for testing. VS's IntelliSense reports 62 errors. The print screen of error list is in the archive.
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: IntelliSense: identifier "xxx" is undefined and some other errors
Reply #4 - Apr 25th, 2016 at 11:48pm
Print Post  
Maybe a solution. Microsoft released Clang compatibility in VS2015 Update 1

I tried using a new Visual Studio project type of Andoid/clang/gcc and the intellisense errors were almost none. No errors when working with "Open Documents" mode (see image).

During the next few weeks/month I will look into using the new VS clang without the Android stuff and instead of the standard Microsoft C++ project type we currently use.

You try it if you want. The android for visual studio system uses C++ projects so Visual Micro should work okay. 

The Android tools for VS are required (free) and can be installed via control panel>add or remove programs>visual studio>change.

Then you can use File>New>Project>Cross Platform>Static Library (Android) to create a project. You can remove any files that are automatically added to the new project. Then add a .ino of the same name and you have an Arduino project. 

In your version of Visual Micro you might need to restart the ide after adding the .ino to a project that was not previously an arduino project. (You don't need to do that in the next release)

You can copy and rename the .vcxproj if you want to use it in an existing standard visual micro project.

When moving files around remember these rules if you want visual micro to see a c++ project as an arduino project:-

  • A project (vcxproj) must be in a folder of the same name
  • The project must contain a .ino of the same name (in the same folder)

Notice that I have changed the "Platform Toolset" to GCC in the project properties

All other project properties can be ignored but you can alter most properties except for macros and include paths which Visual Micro maintains. 

After you have the correct .vcxproj type you should find gcc intellisense works much better.





« Last Edit: Apr 25th, 2016 at 11:55pm by Tim@Visual Micro »  

Please Register or Login to the Forum to see File Attachments
Back to top
WWW  
IP Logged
 
HofiX-CZ
Newbies
*
Offline


Posts: 8
Joined: Apr 24th, 2016
Re: IntelliSense: identifier "xxx" is undefined and some other errors
Reply #5 - Apr 26th, 2016 at 6:47pm
Print Post  
Thank You for the solution. I'll test it right when I finish my work on project to school. I think that I'll place here my experience with your solution in Saturday.
  
Back to top
 
IP Logged
 
HofiX-CZ
Newbies
*
Offline


Posts: 8
Joined: Apr 24th, 2016
Re: IntelliSense: identifier "xxx" is undefined and some other errors
Reply #6 - May 3rd, 2016 at 5:40pm
Print Post  
Tim@Visual Micro wrote on Apr 25th, 2016 at 11:48pm:
The Android tools for VS are required (free) and can be installed via control panel>add or remove programs>visual studio>change.


Hello!

I wanted to try Your solution, but I stucked on the first point: installing Android tools...  Grin

There are plenty of Android tools in the menu. Whitch one is the needed one?
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: IntelliSense: identifier "xxx" is undefined and some other errors
Reply #7 - May 3rd, 2016 at 5:47pm
Print Post  
I think just these two:-

  • Visual C++ Android
  • Clang with Microsoft CodeGen
« Last Edit: May 3rd, 2016 at 5:47pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
HofiX-CZ
Newbies
*
Offline


Posts: 8
Joined: Apr 24th, 2016
Re: IntelliSense: identifier "xxx" is undefined and some other errors
Reply #8 - May 3rd, 2016 at 8:03pm
Print Post  
I installed those 2 tools and created a new project as You described. Then I copied and renamed the source files and IntelliSense seems OK. However another problem appeared. It seems that VS doesn't recognize arduino file properly and I'm not able to compile the project.

Buttons "Build" and "Built and Upload" are disabled and when I try to build by "Debug>Start Debugging", it shows error.

I've also changed the Platform Toolset to GCC 4.9.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
HofiX-CZ
Newbies
*
Offline


Posts: 8
Joined: Apr 24th, 2016
Re: IntelliSense: identifier "xxx" is undefined and some other errors
Reply #9 - May 3rd, 2016 at 8:46pm
Print Post  
Sorry for my previous stupid post.

I have inaccurately added source files to "Solution Items". When I added them to a project "Dynamomer-hlavni_jednotka (android-19)" the problem disappeared and the source can be compiled.

And all IntelliSense errors from my project disappeared!!!  Cheesy Cheesy Cheesy  VS also recognises defined texts from Atmel drivers so the code is much better readable.

So THANK YOU very much for help!!!

However there are 43 IntelliSense error especially in stdio.h. This errors are not problem to me but I'm posting the information here to let You know.

And once again THANK YOU !!!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: IntelliSense: identifier "xxx" is undefined and some other errors
Reply #10 - May 3rd, 2016 at 9:49pm
Print Post  
Hi,

Thanks for the update. I will look into the errors with the new system. 

I think I found the answer to the intellisense errors with the Clang project. I switched the tool bar platform from x86 to ARM and some remaining errors disappeared.


ps:
When time allows, if you can replicate a small example with a standard project, zip the entire project folder and email info[at]visualmicro.com with it sometime that would be appreciated.






« Last Edit: May 3rd, 2016 at 9:50pm by Tim@Visual Micro »  

Please Register or Login to the Forum to see File Attachments
Back to top
WWW  
IP Logged
 
HofiX-CZ
Newbies
*
Offline


Posts: 8
Joined: Apr 24th, 2016
Re: IntelliSense: identifier "xxx" is undefined and some other errors
Reply #11 - May 4th, 2016 at 5:53am
Print Post  
The e-mail is on the way... Smiley
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: IntelliSense: identifier "xxx" is undefined and some other errors
Reply #12 - Jun 3rd, 2016 at 9:23pm
Print Post  
There have been some intellisense improvements for the Due for the next release of visual micro. 

I think it will make a huge difference (but still won't be perfect).
  
Back to top
WWW  
IP Logged
 
neonxc
Newbies
*
Offline


Posts: 9
Joined: Oct 20th, 2014
Re: IntelliSense: identifier "xxx" is undefined and some other errors
Reply #13 - Jun 8th, 2016 at 4:03pm
Print Post  
I have discovered new intellisense error concerning the F macro on arduino leonardo & uno boards this time.

The intellisense is complaining about expected expression when used as argument to Serial.print() for example, however, the project is compiled well.

(using all the newest versions of libraries and stuff)
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: IntelliSense: identifier "xxx" is undefined and some other errors
Reply #14 - Jun 8th, 2016 at 7:06pm
Print Post  
It was caused by the intellisense revamp in the latest release and applied to all avr boards

An update has just been published with a fix 1606.8

Thanks for the report.
  
Back to top
WWW  
IP Logged
 
neonxc
Newbies
*
Offline


Posts: 9
Joined: Oct 20th, 2014
Re: IntelliSense: identifier "xxx" is undefined and some other errors
Reply #15 - Jun 9th, 2016 at 11:18pm
Print Post  
Excellent!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint