I am making my own .cpp and .h files in
/include folder, putting the declarations in .h files and definitions in .cpp files.
Here is the folder structure
- include |- filters |- lowpass_filter.h |- lowpass_filter.cpp |- bandpass_filter.h |- bandpass_filter.cpp |- board.h |- power.h |- power.cpp
VS Code intellisense detects those .cpp files easily.
But when I compile, it says undefined reference. When I put the definitions in .h files as well, and remove .cpp files, it works perfectly.
Is there a fix for that?