PDA

View Full Version : Compiling together multiple files, C++



shynthriir
September 26th, 2009, 11:59 AM
Never mind, ignore this, figured it out.

credobyte
September 26th, 2009, 12:11 PM
#include "custom.h"
In this case, you don't need to do any additional steps - while all the files are in the same directory, g++ will pick them up silently.


Oh, and .. you may want to try:

g++ *.cpp -o main

nvteighen
September 26th, 2009, 03:01 PM
Well, usually a Makefile is used for this so you don't have to recompile modules that haven't been modified... You just recompile the needed modules and finally relink.

Look at this: http://crasseux.com/books/ctutorial/Writing-a-makefile.html