title: Compiling simple Hello World program on OS X via command line
body: <p>I've got a simple hello world example that I'm trying to compile on OS X, named <code>hw.cpp</code>:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  int main() {
    cout &lt;&lt; "Hello world!" &lt;&lt; endl;
    return 0;
  }
  </code></pre>
  
  <p>I'd like to compile it using <code>gcc</code>, but I've had no success. I'd also like to hear the other options, like using Xcode ?</p>