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:
#include "SecondClass.h"
#include "TestClass.h"
void setup()
{
TestClass demo;
SecondClass test(&demo);
test.Method1();
}
void loop()
{
}
TestClass.h (no cpp required)
#pragma once
class TestClass
{
public:
int GetValue(int index)
{ return values[index]; }
private:
int values[5];
};
SecondClass (h & cpp)
pragma once
class TestClass;
class SecondClass
{
public:
SecondClass(TestClass* part) : storePart(part) {}
void Method1(int index);
private:
TestClass* storePart;
};
#include "SecondClass.h"
#include "TestClass.h"
void SecondClass::Method1(int index)
{
storePart->GetValue();
}