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) More than one instance of overloaded function error (Read 11324 times)
Kerr Smith
Newbies
*
Offline


Posts: 8
Joined: Nov 14th, 2014
More than one instance of overloaded function error
Nov 14th, 2014 at 5:31pm
Print Post  
I have just installed the community edition of Visual Studio and the latest beta version of Visual Micro.

I loaded up my project from the basic .ino file as I was previously using Atmel Studio and wanted a clean start and got a red wiggly error line under the function name (doSomething in loop code below). In the Arduino IDE and Atmel Studio there is no error. The code does compile correctly though in my new install, there is just the red error warning.

Below is a minimum stripped version of the code that triggers the error:

String numbers[] = {"one","two","three"};

void setup()
{

}

void loop()
{
     doSomething(numbers);
}

void doSomething(String dataArray[])
{

}

The error says:

More than one instance of the overloaded function doSomething matches the argument list:
Function "doSomething(<error-type> *dataArray)"
Function "doSomething(String *dataArray)"

There is only one instance of the doSomething function though.

When you first type the code it sometimes appears without the line but when Visual Studio is restarted and the project reloaded it shows the error.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: More than one instance of overloaded function error
Reply #1 - Nov 14th, 2014 at 6:52pm
Print Post  
Hi,

This is an intellisense error which can probably be sloved by changing a Visual Studio option. I haven't had much time to experiment with it yes. 

As you correctly state this does not affect build or upload which is managed by Visual Micro. 

Atmel Studio intellisense works slightly different and is more aware of the gcc/Arduino language.

Intellisense errors will never appear in the Arduino Ide because it does not have any intellisense.

If you can't find how to solve this then you can certainly switch off red-squiggles in tools>options

Sorry I can't be more help. I will post more after I find to experiment but feel free to post updates as you find them.

Visual Micro allows you to freely switch between Ide's so use the one that best works for you  Smiley
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: More than one instance of overloaded function error
Reply #2 - Nov 14th, 2014 at 7:27pm
Print Post  
It looks like vs2013 is confused by the prototypes that Visual Micro adds to the vsarduino.h

The next release during the next week excludes the prototypes from 2013 and it seems to fix the intellisense issue. (The change does not affect compilation which remains unchanged)

Thanks for the report.
  
Back to top
IP Logged
 
Kerr Smith
Newbies
*
Offline


Posts: 8
Joined: Nov 14th, 2014
Re: More than one instance of overloaded function error
Reply #3 - Nov 14th, 2014 at 7:44pm
Print Post  
I did notice that as you start to type the function name the list of valid members that pops up does show the vsarduino.h file as having the function in it already and that there is also one overloaded version (the one you created in the code).

When I looked at this file it contained a list of all the functions in the project and I though it a bit odd that it was getting confused by this single function as all the rest of the functions in the code were fine.

Thanks for letting me know about the update, I will install it as soon as it appears on the site.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: More than one instance of overloaded function error
Reply #4 - Nov 14th, 2014 at 7:57pm
Print Post  
Yes the prototypes are used during the compile and not required in vs2012 and vs2013. Without them vs2010 and v2008 do not give intellisense from other .ino files in the same project.

It was a small change and quite important so the latest pre-release has been updated

If you go to the downloads page you will see a link that says "download the latest visual micro beta" (in small text). Close your ide and then click the link to download and run it. 

http://www.visualmicro.com/page/Arduino-Visual-Studio-Downloads.aspx

You will have to click the "more info>run anyway" on the security warning because not many people have downloaded the file yet  Smiley

It's not really a beta because it is due for official release next week.

Thanks
« Last Edit: Nov 14th, 2014 at 7:59pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Kerr Smith
Newbies
*
Offline


Posts: 8
Joined: Nov 14th, 2014
Re: More than one instance of overloaded function error
Reply #5 - Nov 14th, 2014 at 9:09pm
Print Post  
That's great, thanks.

I have just installed it and the error checking is now working as expected - no more wiggly error line in the code for that particular function.

Thanks again for you help with this, it is much appreciated.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: More than one instance of overloaded function error
Reply #6 - Nov 14th, 2014 at 9:18pm
Print Post  
Good to hear. Ongoing I think you will find a few things that the vs intellisense does not understand. The Microsoft C++ is slightly different to Arduino C++ but is should be a 99% fit in most cases.
« Last Edit: Nov 14th, 2014 at 9:19pm by Tim@Visual Micro »  
Back to top
IP Logged
 
stevech
Member
***
Offline


Posts: 147
Location: So. Calif. US
Joined: Jun 16th, 2013
Re: More than one instance of overloaded function error
Reply #7 - Nov 14th, 2014 at 11:45pm
Print Post  
An off-hand comment: I recommend not using the string type on small micros. Memory hogg. Instead, use C style strings and the macros to put the strings in AVR flash if that's the target. The Teensy will take the same code but quietly ignore the flash memory macros for AVR.
  
Back to top
 
IP Logged
 
Kerr Smith
Newbies
*
Offline


Posts: 8
Joined: Nov 14th, 2014
Re: More than one instance of overloaded function error
Reply #8 - Nov 15th, 2014 at 1:51pm
Print Post  
Thanks for the advise on strings.

I found an example (Arrays of strings) at the bottom of the following Arduino page:

http://arduino.cc/en/Reference/PROGMEM

Is this what you mean?
  
Back to top
 
IP Logged
 
markpdx
Newbies
*
Offline


Posts: 3
Location: Portland, OR
Joined: Feb 16th, 2012
Re: More than one instance of overloaded function error
Reply #9 - Nov 18th, 2014 at 9:16pm
Print Post  
Just wanted to let you know, the beta offered here fixed this problem for me too. I was getting Intellisense "red squiggles" when calling functions with a pointer to a byte array as the argument, even though everything compiled and ran perfectly. Squiggles gone now, thanks! Smiley


Tim@Visual Micro wrote on Nov 14th, 2014 at 7:57pm:
Yes the prototypes are used during the compile and not required in vs2012 and vs2013. Without them vs2010 and v2008 do not give intellisense from other .ino files in the same project.

It was a small change and quite important so the latest pre-release has been updated

If you go to the downloads page you will see a link that says "download the latest visual micro beta" (in small text). Close your ide and then click the link to download and run it. 

http://www.visualmicro.com/page/Arduino-Visual-Studio-Downloads.aspx

You will have to click the "more info>run anyway" on the security warning because not many people have downloaded the file yet  Smiley

It's not really a beta because it is due for official release next week.

Thanks

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