Undefined reference to '<Class>::<Function>()'

Hey all.

So I want to preface this with the fact that I'm not the finest C++ programmer, so I'm posting at risk of the problem being something simple.

I've been developing over the last few months with no issues whatsoever, but for some reason I've been getting all sorts of linker errors the last few days. I've been completely unable to make sense of why they're occuring... I've boiled the project down to the simplest project I could that still reproduces the error.

At a high level, it looks like the linker thinks the function found in a '.h' file isn't defined, when in reality it's fully defined in an associated '.cpp' file.

Here is the error in question:

[Starting] Verifying sketch 'Program.ino'
Loading configuration...
Initializing packages...
Preparing boards...
Verifying...
C:\Users\<User>\AppData\Local\Temp\cczV9GNg.ltrans0.ltrans.o: In function `setup':
c:\Users\<User>\Documents\<Path>\Program/Program.ino:7: undefined reference to `Screen::Setup()'
C:\Users\<User>\AppData\Local\Temp\cczV9GNg.ltrans0.ltrans.o: In function `_GLOBAL__sub_I_screen':
c:\Users\<User>\Documents\<Path>\Program/Program.ino:3: undefined reference to `Screen::Screen(unsigned char, unsigned char, unsigned char)'
C:\Users\<User>\AppData\Local\Temp\cczV9GNg.ltrans0.ltrans.o: In function `_GLOBAL__sub_D_screen':
c:\Users\<User>\Documents\<Path>\Program/Program.ino:3: undefined reference to `Screen::~Screen()'
collect2.exe: error: ld returned 1 exit status
exit status 1
IntelliSense configuration already up to date. To manually rebuild your IntelliSense configuration run "Ctrl+Alt+I"
[Error] Verifying sketch 'Program.ino': Exit with code=1

And here is a zip with the project files:
Program.zip (1.0 KB)

Thanks!

See if this thread helps. I'd also say to add include guards to Screen.h i.e.

// At the top of Screen.h:
#ifndef SCREEN_H
#define SCREEN_H

// Rest of your code

#endif

One more thing; I'm not exactly sure how you're trying to initialize your screen object? I think the syntax is typically this:

Screen screen(8, 8, 13);

However, I haven't been programming in cpp for very long... if your way is another way of initializing, I'd like to learn about it.

Hope that helps!

I did look through that article before, but I whisked through it again and found the missing piece. My .h/.cpp files all need to be located in a 'src' folder.

:man_facepalming:

Ahh! Good to know. I didn't know that was a requirement...