This is likely a C++ issue, and my lack of familiarity with it, but I haven’t figured this out, nor found a solution online. Here is a simple program
class A {
};
class B {
A a;
void doSomething(A& a) { }
};
void setup() {
}
void loop() {
}
The error message is
In file included from ../inc/spark_wiring.h:29:0,
from ../inc/application.h:29,
from classproblem.cpp:2:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
classproblem.cpp:3:18: error: variable or field 'doSomething' declared void
void doSomething(A& a);
^
classproblem.cpp:3:18: error: 'A' was not declared in this scope
classproblem.cpp:3:21: error: 'a' was not declared in this scope
void doSomething(A& a);
^
I think the bit about variable or field declared void is a misleading side effect of the problem, because if I remove the parameter from doSomething(), it compiles without error.
If I change the defintion of doSomething to “void doSomething(A a) { }”, then the error becomes
In file included from ../inc/spark_wiring.h:29:0,
from ../inc/application.h:29,
from classproblem.cpp:2:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
classproblem.cpp:3:18: error: variable or field 'doSomething' declared void
void doSomething(A a);
^
classproblem.cpp:3:18: error: 'A' was not declared in this scope
make: *** [classproblem.o] Error 1
Can anyone point me to the proper fix for this?
I’ve edited your post to properly format the code. Please check out this post, so you know how to do this yourself in the future. Thanks in advance! ~Jordy