title: Default to lib=stdlibc++ for clang++ on Mac OS Mavericks with Xcode?
body: <p>I'm running MacOS X Mavericks with Xcode 5.1.1 including the command line tools.
  I'm compiling simple C++ programs using clang++ supplied with Xcode, the version info is:
  Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)</p>
  
  <p>What I find is that if I try to run the following command</p>
  
  <blockquote>
    <p>clang++ -o hello.out hello.cpp</p>
  </blockquote>
  
  <p>I get the following errors:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
  "std::ios_base::Init::Init()", referenced from:
  ___cxx_global_var_init in hello-2ad0da.o
  "std::ios_base::Init::~Init()", referenced from:
  ___cxx_global_var_init in hello-2ad0da.o
  "std::cout", referenced from:
  _main in hello-2ad0da.o
  "std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp; std::operator&lt;&lt;&lt;std::char_traits&lt;char&gt; &gt;(std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;, char const*)", referenced from:
  _main in hello-2ad0da.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>If I change the command to</p>
  
  <blockquote>
    <p>clang++ -o hello.out -stdlib=libstdc++ hello.cpp</p>
  </blockquote>
  
  <p>I don't get any errors.</p>
  
  <p>Is there a way to make "-stdlib=libstdc++" the default for clang++, either with some configuration setting or some environment variable? Also, just for my information, why do I get the error?</p>