Here is the home page of libc++:
You can download the tip-of-trunk libc++ from there. You can tell clang to point to your download with -nostdinc++ -I<path-to-libc++>/include
. You can also tell clang to link to your tip-of-trunk libc++ with -L<path-to-libc++>/lib
and export DYLD_LIBRARY_PATH=<path-to-libcxx>/lib
. The directions are all on the libc++ home page.
Xcode is the easiest way to get clang + libc++. But if you want the very latest, this is the place to go.
Congratulations!
Don't worry about the ld warning. It is a harmless ld bug that will be fixed in a future release. I see it on 10.8.4 too and it doesn't hurt anything.
The libc++ headers no longer live at /usr/include/c++/v1
. Xcode has migrated them into itself. Having libc++ headers at /usr/include/c++/v1
from older installs has been a source of confusion and bugs. I regularly use -nostdinc++ -I
to point to the libc++ headers I want (I often have several versions going at the same time), and that works well for me.
It is possible for you to replace your /usr/lib/libc++.1.dylib
with that you have built. I do not recommend doing this. I have to sometimes to do a proper test, but I always do so very carefully because sometimes this causes me to have to reboot onto a backup disk and restore my /usr/lib
to its original state. If you do go this route, it is a very good idea to have a backup of the original /usr/lib/libc++.1.dylib
very handy.
I recommend instead -L
on the command line, and export DYLD_LIBRARY_PATH=<path-to-libcxx>/lib
in the shell. More than one person (including myself) has gotten their computer into a really nasty place by not following this advice.
If you run testit
(under test/
), all you need is DYLD_LIBRARY_PATH
in that shell. The testit
script is set up to point to the right places without an install.
Also I recommend figuring out why you had to modify buildit
. No one else is seeing that behavior. printenv
on your command line may help in this endeavor.
libc++ is updated often. We try to keep tip-of-trunk always in a shippable state.