title: How to compile C++ program by command line on Mac
body: <p>I used to use <code>Xcode</code> to build and run <code>C++</code> program.</p>
  
  <p>I use command line to compile the same source code in my <code>Xcode</code> project.</p>
  
  <p>Compiling a individual <code>.cpp</code> file is OK.</p>
  
  <p>Compiling more complicated project(more than one file) is NOT OK.</p>
  
  <p>I have tried <code>gcc</code>, <code>g++</code>, <code>clang</code>, <code>clang++</code>.</p>
  
  <p>The main problem is undefined symbol.</p>
  
  <p>Could you show how to compile complicated project (more than one file) by command line?</p>