Hey guys, I am trying to figure out how to use headerfiles in VEXCode to make my code more organized. However, when trying to learn through examples on my computer, I ran into errors stating "use of undeclared identifier “MyClass”. Here are my two files below. Am I missing anything like a declaration?
header1.h -
#ifndef MY_FILE
#define MY_FILE
#include “vex.h”
void function1();
class myClass {
public:
myClass();
void function2();
};
#endif
header1.cpp -
#include “header1.h”
void function1(){
// Do something
}
void MyClass::myClass(){
// Do something
}
void MyClass::function2() {
// Do something
}
This code is from an example on a different forum. Is there anything I need to declare first? Thanks.