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 Incomplete error messages (Read 7262 times)
sixeyes2
Junior Member
**
Offline


Posts: 93
Location: Guildford, United Kingdom
Joined: Dec 19th, 2011
Incomplete error messages
Dec 30th, 2011 at 9:19pm
Print Post  
I've been having some issues with the error messages reported by the compiler when I use VM.

Here's the error messages reported by VM:

RelayBoxScheduler.cpp : In member function Enum) const'
RelayBoxScheduler.cpp : GetLeftButtonTotal()'
ButtonStatus.h : Enum) const
RelayBoxScheduler.cpp : GetRightButtonTotal()'
ButtonStatus.h : Enum) const
Error compiling

Not very illuminating. Eventually I decided to fire up the Arduino IDE and I get more complete error messages:

RelayBoxScheduler.cpp: In member function 'ButtonPressState::Enum RelayBoxScheduler::GetControllerButtonState(ControllerId::Enum) const':
RelayBoxScheduler.cpp:79: error: no matching function for call to 'ButtonStatus::GetLeftButtonTotal()'
/ButtonStatus.h:50: note: candidates are: uint8_t ButtonStatus::GetLeftButtonTotal(ControllerId::Enum) const
RelayBoxScheduler.cpp:80: error: no matching function for call to 'ButtonStatus::GetRightButtonTotal()'
/ButtonStatus.h:63: note: candidates are: uint8_t ButtonStatus::GetRightButtonTotal(ControllerId::Enum) const

Not sure why VM has lost these details but it is annoying. In this case I'd forgotten to pass a parameter to the function.

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Incomplete error messages
Reply #1 - Dec 31st, 2011 at 3:45pm
Print Post  
If you can send me an example i can improve the error handling. v21 had some minor improvements, obviously not enough Smiley

The reason for the problem is that arduino ide doesn't provide drill down into the error so it doesn't need to chop uop the errors and try to make sense of them. 

Arduino can just display the avr-gcc results which in this case is a mass of text. Believe it or not the text you see is probably no more that one or two errors returned from avr-gcc.

So, to enable drill down into each file mentioned in an error we need to pass a line at a time to the visual studio output window. but avr-gcc doesn't return a line for each file.

The vm code handling errors is very crude and needs revisting. Hopefully we can find some better avr-gcc switches that returned more structured info, otherwise we will have to find a better alternative.

The final thing to keep in mind is that the compile is done in temp folders and errors contain fill paths to files in the temp folders. So there is also some parsing of files names to resolve back to original file locations however avr-gcc doesn't alsways put the file name in the same place in an error. this area needs some close attention and thought  Cry
  
Back to top
IP Logged
 
sixeyes2
Junior Member
**
Offline


Posts: 93
Location: Guildford, United Kingdom
Joined: Dec 19th, 2011
Re: Incomplete error messages
Reply #2 - Dec 31st, 2011 at 9:43pm
Print Post  
OK. Here's an example. I found you needed a PDE and two classes. In VM you get:

CompilationErrorMessages.pde : In function 'void setup()'
CompilationErrorMessages.pde : Method1()'
SecondClass.h : Method1(int)
SecondClass.cpp : In member function Method1(int)'
SecondClass.cpp : GetValue()'
TestClass.h : GetValue(int)

but in the Arduino IDE you get:

CompilationErrorMessages.cpp: In function 'void setup()':
CompilationErrorMessages.pde:-1: error: no matching function for call to 'SecondClass::Method1()'
/SecondClass.h:9: note: candidates are: void SecondClass::Method1(int)

Files used are below

PDE:
Code
Select All
#include "SecondClass.h"
#include "TestClass.h"

void setup()
{
	TestClass demo;
	SecondClass test(&demo);

	test.Method1();
}

void loop()
{
}
 



TestClass.h (no cpp required)
Code
Select All
#pragma once

class TestClass
{
public:
	int GetValue(int index)
	{ return values[index]; }

private:
	int values[5];
};
 



SecondClass (h & cpp)
Code
Select All
pragma once

class TestClass;

class SecondClass
{
public:
	SecondClass(TestClass* part) : storePart(part) {}
	void Method1(int index);

private:
	TestClass* storePart;
};
 


Code
Select All
#include "SecondClass.h"
#include "TestClass.h"

void SecondClass::Method1(int index)
{
	storePart->GetValue();
}
 

  
Back to top
 
IP Logged
 
Heinz Kessler
Full Member
***
Offline


Posts: 217
Location: Freiburg, Germany
Joined: May 25th, 2012
Re: Incomplete error messages
Reply #3 - Jun 10th, 2012 at 7:03am
Print Post  
Hello,
even though I don't know the VM codebase, I think the cause for the incomplete messages is much simpler:
VM tries to suppress the line numbers within the error messages, because it takes care for that itself. But it looks like it gets confused with all the colons.
In error messages like

RelayBoxScheduler.cpp:79: error: no matching function for call to 'ButtonStatus::GetLeftButtonTotal()'

VM cuts away everything from the file name up to the last ':'. Instead it should search for the line number enclosed by ':'s and should leave the rest of the line intact.

I hope VM will correct that in future releases, because that bug often makes interpreting errors quite hard.
« Last Edit: Jun 10th, 2012 at 7:04am by Heinz Kessler »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Incomplete error messages
Reply #4 - Jun 10th, 2012 at 10:07am
Print Post  
Yes you are right. This area certainly needs more work but we haven't had time to look into a better system.

It would be useful to know if there is a standard format in these errors. The formatting appeared to be quite ad hoc but maybe it just needs more thought.

If you would add this as a visualmicro.codeplexcom issue it will serve as a good reminder for the next build. I think sixeyes made a good suggestion but it got lost in mass Smiley

  
Back to top
IP Logged
 
Madz
Newbies
*
Offline


Posts: 2
Location: Australia
Joined: Feb 14th, 2013
Re: Incomplete error messages
Reply #5 - Mar 25th, 2013 at 9:58am
Print Post  
Hi I'm getting this issue - I assume it's still outstanding? I went to visit the issue tracker - but I think it's pointing us back to use the forum now? So i just thought I'd bump this for an update. Cheers
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Incomplete error messages
Reply #6 - Mar 25th, 2013 at 11:01am
Print Post  
Coming soon thanks
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint