Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9179579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:49:58+00:00 2026-06-17T17:49:58+00:00

I heavily use the c++0x/c++11 features in my project, particularly code blocks and shared

  • 0

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.

clang: error: invalid deployment target for -stdlib=libc++ (requires Mac OS X 10.7 or later)

It appears that Apple is trying to force people to upgrade by not allowing developers to support Snow Leopard. This makes me angry. Arrrggg!!!

What can I do?

EDIT: 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.

UPDATE 1: 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.

UPDATE 2: I’ve since upgraded to Xcode 5.0.2. The technique listed in the selected answer below still works as expected.

UPDATE 3: I’ve since upgraded to Xcode 5.1. The technique listed in the answer below does not yet work for this version!

UPDATE 4: I’ve since upgraded to Xcode 6.0.1. The technique listed in the selected answer below appears to be working again.

UPDATE 5: 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 Bitcoding 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).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:49:59+00:00Added an answer on June 17, 2026 at 5:49 pm

    Apple has decided to only officially support libc++ on 10.7 or higher. So the version of clang/llvm that ships with Xcode checks to see if the deployment target is set for 10.6 when using libc++, and prevents you from compiling. However, this flag is not included in the open source version of clang/llvm.

    Take a look at this thread:
    http://permalink.gmane.org/gmane.comp.compilers.clang.devel/17557

    So, to compile a project that is using c++11 for 10.6 deployment, you need to give Xcode the open source version. Here is one way of doing it:

    1. Download the open source version of clang from here (use LLVM 3.1 for Xcode 4.5.x; use LLVM 3.2 for Xcode 4.6.x; use LLVM 3.3 for Xcode 5.0.x; use LLVM 3.5.0 for XCode 6.0.1; use LLVM 3.7.0 for XCode 7.1.1):
      http://llvm.org/releases/download.html
    2. Make a backup of Xcode’s default clang compiler and put it in a safe place (In case you screw up!)
      This is located at:
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
    3. Replace the default clang compiler with the one you downloaded from [1]
    4. chown the clang binary for root:wheel with sudo chown root:wheel clang from the bin directory listed in [2].
    5. Startup Xcode and compile!

    UPDATE #1: This technique does not currently work for Xcode 5.1 or newer, which relies on LLVM 3.4. When I get some more time, I will try and find a solution to post here. But if someone comes up with a solution before me, they should post it as an answer.

    UPDATE #2: Unfortunately I can’t remember if I ever found a solution for Xcode 5.1, however I can confirm that the technique does still work for Xcode 6.0.1. I haven’t tested on versions newer than that, but it could still work.

    UPDATE #3: This technique appears to still work with XCode 7.1.1 using LLVM 3.7.0. However, the open source LLVM clang does not support Bitcoding. So you will need to switch between the open source compiler and Apple’s compiler in order to develop for both 10.6 and tvOS/watchOS (which require Bitcoding).

    P.S.: The Mac OS X binaries for LLVM 3.4 and 3.5.0 are listed as “Clang for Darwin 10.9” at http://www.llvm.org/releases/download.html rather than as “Clang Binaries for Mac OS X” in previous versions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is heavily trimmed down source code from a webpage I'm working on right
I am using EF Code First. I heavily use code annotations to specify how
Does Castle project DynamicProxy heavily use Reflection ... like constantly? Or does it do
I'm on a project which heavily favors the use of .csv files for data
In my project I heavily make use of TPL, and I decide to design
I use Visual Studio's Code Snippet feature pretty heavily while editing c# code. I
I'm working on a scheme that will heavily use array fields in mongo documents,
I use linux screen heavily , generally if the OS didn't restart or say
I start to use Java annotations heavily. One example is taking method with annotations
What technique should we use to make the httpsession object not loaded heavily with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.