[LLVMdev] [SOLVED] Errors linking against libLLVMCore

Rick Mann rmann at latencyzero.com
Sat Dec 29 00:40:45 PST 2012

On Dec 27, 2012, at 10:24 , John Criswell <criswell at illinois.edu> wrote:

> It is possible (but a bit unlikely) that your problem is because you're not linking in libstdc++.  Some C++ methods are defined in header files; that might explain why your simple program works but using libLLVMVMCore.a doesn't work.

So, you were right. Xcode was invoking the link with -stdlib=libc++, but should have either not been passing that at all, or using -stdlib=libstdc++ (the GNU standard library, and the default if no option is passed).

>From the description in Xcode:

libstdc++: traditional C++ standard library that works with GCC and the LLVM Compiler (default).
libc++: highly optimized C++ standard library that works only with the LLVM Compiler, and is designed to support new C++11 features.

Which makes me wonder why the LLVM build doesn't use the better library (libc++). I'm assuming this is the root of the problem, that the LLVM build used libstdc++, instead of libc++.

Can anyone clarify what's going on? Is it possible to build LLVM with libc++? I guess to do that, it would have to be built by clang instead of GCC, huh? Can that be done?


More information about the llvm-dev mailing list