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 IntelliSense: cannot overload functions distinguished by return type alone (Read 10745 times)
marc
Junior Member
**
Offline


Posts: 12
Location: Belgium
Joined: Jan 29th, 2012
IntelliSense: cannot overload functions distinguished by return type alone
Jul 24th, 2012 at 10:00am
Print Post  
Hello,

I have found a small bug that doesn't influence the compilation of the program:

When you load this small project into VM, at first, the function "toIpString" is underlined in red with the message: IntelliSense: cannot overload functions distinguished by return type alone.

When you compile the program, you still have this error.
When you click with the mouse cursor into the editor window, and you scroll the window up or down until the line with the error init disappears from the editor window, the red underscore line is gone.  

I am using the latest beta version for the moment.(Arduino 1.0.1 for Visual Studio (1207.19))

Code
Select All
struct WiFiSetupStruct
{	byte ipaddr[4];			// Device IP address
	byte gwaddr[4];			// Device gateway address
	byte snaddr[4];			// Device subnet mask
	byte serveraddr[4];		// Device server address
} WiFiSetup = {
	{192,168,1,245},
	{192,168,1,1},
	{255,255,255,0},
	{192,168,1,200}
};

String toIpString(byte arg[], int len){
	String S = NULL;
	for(int i=0; i<len; i++)
	{
		S = S + String(arg[i]);
		if(i < len - 1) S = S + ".";
	}
	return (String)S;
}

void setup()
{
	Serial.begin(9600);
	Serial.println(toIpString(WiFiSetup.ipaddr,(int)sizeof(WiFiSetup.ipaddr)));
	Serial.println(toIpString(WiFiSetup.gwaddr,(int)sizeof(WiFiSetup.gwaddr)));
	Serial.println(toIpString(WiFiSetup.snaddr,(int)sizeof(WiFiSetup.snaddr)));
	));
}

void loop()
{

  /* add main program code here */

}
 




Regards,

Marc
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: IntelliSense: cannot overload functions distinguished by return type alone
Reply #1 - Jul 24th, 2012 at 11:02am
Print Post  
Hi marc,

You are right that the compile always works, this is just VS intellisense issue.

Most of the intellisense sense errors are not vm bugs. 

We use the C++ intellisense in visual studio which is not entirely correct for arduino. 

However, in this case I think you are seeing a visual studio bug because it seems to recognise the code as valid after scrolling the window Smiley

Arduino in Visuaol Studio is a 99% solution. If you find any way around these things then let me know and I will add to vm

Sometimes, depending on your application, it can help to click "Project>Show All Arduino Files"

Like your code!

Thanks
« Last Edit: Jul 25th, 2012 at 9:39pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint