
Once a class is pretty much "finished" (yeah like it's ever really finished) it's useful to compile it as a library. Compiling a class as a library is better than copying or linking the c++ and header files to each directory for programs that want to use that class. It's also better than recompiling the class for each program that wants to use it. And it's better than having great long paths in each Makefile. Shared object libraries can also help with memory if you've got more than one instance of the library in use at any one time.
/usr/bin/g++ -O -c blah.cpp This compiles the source file, with optimisation (-O) but without linking (-c). Do this for each source file (so do /usr/bin/g++ -O -c blah2.cpp etc.)
rm -f libblah.a This removes any previous libraries (only really useful if you've built a library before, but if you have, it can be an important step).
ar r libblah.a blah.o blah2.o ar is the archiver command, and it creates one file which contains any number of other files, complete with metadata. This will return the message ar: creating libblah.a
chmod +rx libread_csv.a Make the file readable and executable
cp libblah.a /home/csunix/hannah/libs/ Put it in a sensible place (obviously change this to a path to your own home directory).
ln -sf /home/csunix/hannah/libs/sources/read_csv/*.h /home/csunix/hannah/include/ Create symbolic links to the header files in another sensible place
Having put the libraries in a sensible place (traditionally in a subdirectory called libs in your home directory) and linked the header files to a suitably sensible place (traditionally a subdirectory of your home directory called include) you need need to tell any programs that include these libraries where they are. It's a two-stage compilation process (first compile the object files, then link these together to create the program).