Skip to main content

15.1) Naive Approach


A multi-file program can be compiled like so:

g++ file1.cpp file2.cpp file3.cpp -o prog
  • All source files will be processed every time this command is run
  • If file2.cpp is the only file that has changed since the last compile, this is unnecessarily inefficient; delays could be noticeable if file1.cpp and file3.cpp are large