Hi jonathontopf,
in the .hpp file you need to #include the headers for the classes, types that you use in that file , that have been declared elsewhere (e.g., #include <vector> if you use std::vector).
Also, in any .cpp file, you need to #include all header files for the classes, types, etc. that you use in that file that have been declared elsewhere. In person_class.cpp you undoubtedly define and use classes, types, etc. that you declare in person_class.hpp, so you need an
#include "person_class.hpp"
in there, as well as the standard headers such as
#include <vector>
, if you use vectors, as mentioned above. (Also note that you should use quotes for header files that you define and <> for standard headers.)
You then compile your individual source (i.e. .cpp files) to obtain an identical number of object files. The included header files will expand to provide the complier with the declarations contained within it. In the case of person_class.cpp, you will get a file person_class.o by doing, e.g.,
In main.cpp, once again, you include all header files for the types, classes that you use in main.cpp that are declared elsewhere.
You then build the execution file and link it to the object files of your source files by doing, e.g.,
g++ -o main main.cpp person_class.o
You will then get an executable ``main'' that, when run, will execute your full program.
As Disch says above, if you use an IDE then this is done automatically once you have specified you build configurations. I have shown here how you could compile and link your source files to you main application you from the command line.
Hope that helps.