title: How do I get back c++0x/c++11 support for Mac OS X 10.6 deployment using Xcode 4.6.2 thru 7.1.1
body: <p>I heavily use the c++0x/c++11 features in my project, particularly code blocks and shared pointers. When I upgraded my OS to 10.8 Mountain Lion (Edit: From 10.7), I was forced to upgrade Xcode. In upgrading Xcode, I lost the ability to compile my c++ project for deployment on 10.6 systems as I get the following error.</p>
  
  <p><code>clang: error: invalid deployment target for -stdlib=libc++ (requires Mac OS X 10.7 or later)</code></p>
  
  <p>It appears that Apple is trying to force people to upgrade by not allowing developers to support Snow Leopard. This makes me angry. Arrrggg!!!</p>
  
  <p>What can I do?</p>
  
  <p><strong>EDIT:</strong> After several comments back and forth, it should be made clear that 10.6 does not ship with system libc++ libraries. As a result, simply being able to build a libc++ project for 10.6 deployment is not enough. You would also need to include libc++ binaries with your 10.6 distribution or statically link to them. So lets continue with the premise that I am already doing that.</p>
  
  <p><strong>UPDATE 1:</strong> This question was originally intended for use with Xcode 4.5.2 (the latest version at the time the question was asked). I have since upgraded to Xcode 4.6.3 and have updated the question and answer to reflect that.</p>
  
  <p><strong>UPDATE 2:</strong> I've since upgraded to Xcode 5.0.2. The technique listed in the selected answer below still works as expected.</p>
  
  <p><strong>UPDATE 3:</strong> I've since upgraded to Xcode 5.1. The technique listed in the answer below does not yet work for this version!</p>
  
  <p><strong>UPDATE 4:</strong> I've since upgraded to Xcode 6.0.1. The technique listed in the selected answer below appears to be working again.</p>
  
  <p><strong>UPDATE 5:</strong> I've since upgraded to Xcode 7.1.1. The technique listed in the selected answer below appears to be working again, with one important caveat. You must disable <a href="https://developer.apple.com/library/tvos/documentation/IDEs/Conceptual/AppDistributionGuide/AppThinning/AppThinning.html" rel="noreferrer">Bitcoding</a> used for AppThinning since the opensource LLVM version doesn't support it (nor should it). So you will need to switch between the open source and Apple LLVM clang in order to compile for both 10.6 and tvOS/watchOS (since Bitcoding is required for those OSes).</p>