"libc++" C++ Standard Library

libc++ is a new implementation of the C++ standard library, targeting C++0X.

All of the code in libc++ is dual licensed under the MIT license and the UIUC License (a BSD-like license).

Features and Goals

Why a new C++ Standard Library for C++'0x?

After its initial introduction, many people have asked "why start a new library instead of contributing to an existing library?" (like Apache's libstdcxx, GNU's libstdc++, STLport, etc). There are many contributing reasons, but some of the major ones are:

Platform Support

libc++ is known to work on the following platforms, using g++-4.2 and clang (lack of C++0X language support disables some functionality).

Current Status

libc++ is still under development. It has about 98% of N3126 implemented/tested. C++'98 support is fully featured, and most of C++'0x support is as well. The only major missing piece of C++'0x support is <atomic>.

Here is a by-chapter breakdown of what is passing tests and what isn't. This chart is currently based on testing against g++-4.4.0 with -std=c++0x.

A Windows port is underway. Here are recent test results.

Get it and get involved!

First please review our Developer's Policy.

To check out the code, use:

On Mac OS 10.7 (Lion), the easiest way to get this library is to install Xcode 4.2 or later. However if you want to install tip-of-trunk from here (getting the bleeding edge), read on. However, be warned that Mac OS 10.7 will not boot without a valid copy of libc++.1.dylib in /usr/lib.

To build on Mac OS X 10.6 (Snow Leopard), you need a helper library and header found here. cp cxxabi.h to /usr/include, and cp libc++abi.dylib to /usr/lib. On Mac OS X 10.7 (Lion) and later, this helper library and header are already installed for you.

Next:

That should result in a libc++.1.dylib. To install it I like to use links instead of copying, but either should work:

To use with clang you can:

To run the libc++ test suit (recommended):

Send discussions to the (clang mailing list).

Design Documents