asimes
asimes

Reputation: 5904

Building Clang, libstdc++4.6 to libstdc++4.7

I am trying to build Clang following this: http://clang.llvm.org/get_started.html

At step 6 the command ../llvm/configure runs a series of checks and one tells me:

checking whether Clang will select a modern C++ standard library... no
configure: error:
We detected a missing feature in the standard C++ library that was known to be
missing in libstdc++4.6 and implemented in libstdc++4.7. There are numerous
C++11 problems with 4.6's library, and we don't support GCCs or libstdc++ older
than 4.7. You will need to update your system and ensure Clang uses the newer
standard library.

If this error is incorrect or you need to force things to work, you may pass
'--disable-compiler-version-checks' to configure to bypass this test.

I don't know how to resolve this and google searches for libstdc++4.7 did not produce anything useful to me or something I understand. How do I go about replacing / upgrading this? I am on a Mac (10.7.5)

Upvotes: 9

Views: 4580

Answers (4)

jwatt
jwatt

Reputation: 870

For me this happened because I had the old clang and clang++ that I'd previously built from source (the one I was attempting to build to replace) coming first in my PATH. These were too old. Removing those two files so that the build process would use the clang and clang++ that comes with XCode's Command Line Tools and then rebuilding worked fine.

Upvotes: 0

john07
john07

Reputation: 560

i have the same error on mac 10.8.5 xcode 5.0 configure option --enable-libcpp resolve my problem ../llvm/configure --enable-cxx11 --enable-optimized --enable-libcpp

Upvotes: 2

Ivan Jibaja
Ivan Jibaja

Reputation: 106

I ran into the same problem. The easiest way to build Clang is to use libc++ instead of libstdc++. If you don't have libc++, you can obtain it by installing XCode 4.2 (or newer) or you can build it yourself by following the instructions here: http://libcxx.llvm.org/

After you have libc++ installed, you can use the --enable-libcpp=yes flag with the configure command.

Upvotes: 9

Eli Bendersky
Eli Bendersky

Reputation: 273636

Just this week, the LLVM & Clang project upped the minimal compiler version requirement to gcc 4.7, with its libstdc++. You'll need to install or build a newer gcc.

Here's a blog post I wrote earlier today about building gcc 4.8 on Ubuntu 12.04 and using that to compile trunk LLVM & Clang. Hope this helps!

Upvotes: 7

Related Questions