I've been building many C++ projects for my university recently. They were consisted of multiple files with one Makefile. All in a prj folder with Makefile within, the source files in src folder and headers in inc folder. Makefile compiled it to object files in obj folder and than linked it to the final program.
I do got many strange errors which I broke down into that, e.g. I've included Matrices.h in Vector.h file and Vector.h in a Matrix.h. The compiler than said that some methods do not exist in a Matrix class.
I have to include Vector.h in Matrix.h. Then, include Matrix in main.cpp. I use sqrt() and pow() functions in all files.
Now I wonder is it proper to avoid declaring continously <cmath> library in Vector.h, then Matrix.h and finally in main.cpp? I'd rather just declare it in Vector.h and leave it. The complier is g++ and its Linux Debian.
I use preprocessor directives:
#ifndef VECTOR_HH //or MATRIX_HH etc.
#define VECTOR_HH
#include <cmath>
//class body
#endif`