title: Using G++ to compile multiple .cpp and .h files
body: <p>I've just inherited some C++ code that was written poorly with one cpp file which contained the main and a bunch of other functions. There are also <code>.h</code> files that contain classes and their function definitions.</p>
  <p>Until now the program was compiled using the command <code>g++ main.cpp</code>. Now that I've separated the classes to <code>.h</code> and <code>.cpp</code> files do I need to use a makefile or can I still use the <code>g++ main.cpp</code> command?</p>