Classes in other files not found

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.

1 Like

class myClass {

void MyClass::myClass(){

Remember that C++ (and most other programming languages) are case sensitive. So, you’ll have to change your declarations of myClass to MyClass, or vice-versa.

4 Likes

yep! it fixed the issue along with saving the file. Thanks so much! Also, how would I go about calling the method in my main.cpp file?