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 9233013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:27:04+00:00 2026-06-18T06:27:04+00:00

This all seems like a colossal mess. All I want is a compiler that

  • 0

This all seems like a colossal mess.
All I want is a compiler that implements C++11, so I can use <chrono>. But I’m so confused from the very beginning.

Currently, I build programs by invoking G++, but when I check the version via $ g++ -v, I get:

gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build
2336.11.00)

What’s going on? Am I using G++? GCC? LLVM? I don’t even know. Are they the same thing?

So now I’m trying to build and download GCC 4.7 via gnu.org, but I have no idea what any of the guides are talking about. I’ve never seen so many acronyms for things I dont know.

Why is this so complicated? What’s with all those versions, with some of them only implementing some parts of C++11 and not others?

  • 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-18T06:27:05+00:00Added an answer on June 18, 2026 at 6:27 am

    Here’s the situation on OS X.

    There are two C++ compilers installed by default.

    [5:49pm][wlynch@watermelon ~] g++ --version
    i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
    
    [5:49pm][wlynch@watermelon ~] clang++ --version
    Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
    

    g++ is running llvm-gcc, which is the gcc frontend, and then the llvm backend.

    clang++ is running clang, which is the clang frontend and then the llvm backend.

    If you want a C++11 compiler on OS X without installing other packages, your only option is to use the clang compiler.

    The flags necessary are:

    clang++ -stdlib=libc++ -std=gnu++11
    

    To describe the two flags I’m passing:

    • -stdlib=libc++ uses the libc++ standard library, instead of the gnu libstdc++. On OS X, the libc++ version has c++11 support. The gnu libstdc++ one does not.
    • -std=gnu++11 tells the compiler to support c++11 code features, like lambdas and enum class. You can also pass -std=c++11, which is similar, but does not enable some commonly expected gnu extensions.

    Update for OS X 10.9: As of OS X Mavericks, both g++ and clang++ are actually using clang. The only difference, is that g++ will imply -stdlib=libstdc++ and clang++ will imply -stdlib=libc++. So, on Mavericks, if you’d like to use C++11, you can follow the above advice, or just do:

    clang++ -std=gnu++11
    

    Update for OS X 10.10: As of OS X Yosemite, g++ is still clang in disguise. However, neither uses libstdc++ by default anymore. Both are now on libc++.

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

Sidebar

Related Questions

I know this seems like a repeat question, but i've read all the others
All, this seems like a simple problem but it's giving me fits. Lets say
This seems like such a trivial thing but I can’t for the life of
This seems like something neat that might be built into jQuery but I think
okay, i have no idea why this isn't working at all. it seems like
Sorry if this question seems a bit complex but I think its all related
Hi all I can't find the error in this table creation bit, seems really
I've been stuck on this all morning, even though it seems like it should
I've searched for answers to this -- seems like all the answers relate to
I'd like to send a synthetic keypress event to X. This all seems to

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.