Compiling multiple files

Finally solved it Is there any tutorial on running root entirely with g++?, the questions are different but related.