问题
I need clang API to do parsing of C++ programs. I installed clang 2.9 (along with llvm. The installation went fine, now i figured out that i need to install libc++ also. The thing is I get errors following while i try to 'make' libc++ from source.
[ 4%] Building CXX object lib/CMakeFiles/cxx.dir/__/src/iostream.cpp.o
In file included from /home/vmplanet/usr/libcxx/include/typeinfo:61:0,
from /home/vmplanet/usr/libcxx/include/memory:590,
from /home/vmplanet/usr/libcxx/include/algorithm:594,
from /home/vmplanet/usr/libcxx/include/string:434,
from /home/vmplanet/usr/libcxx/include/__locale:15,
from /home/vmplanet/usr/libcxx/include/ios:216,
from /home/vmplanet/usr/libcxx/include/ostream:130,
from /home/vmplanet/usr/libcxx/include/__std_stream:15,
from /home/vmplanet/usr/libcxx/src/iostream.cpp:10:
/home/vmplanet/usr/libcxx/include/exception: In member function ‚'std::exception_ptr::operator bool() const‚':
/home/vmplanet/usr/libcxx/include/exception:134:59: error: no match for ‚'operator!=‚' in ‚'((const
std::exception_ptr*)this)->std::exception_ptr::_ptr != std::_1::_get_nullptr_t()‚' /home/vmplanet/usr/libcxx/include/cstddef:76:39: note: candidate is: bool std::_1::operator!=(std::_1::nullptr_t, std::__1::nullptr_t)
make[2]: * [lib/CMakeFiles/cxx.dir/__/src/iostream.cpp.o] Error 1
make[1]: * [lib/CMakeFiles/cxx.dir/all] Error 2
make: * [all] Error 2
来源:https://stackoverflow.com/questions/6449048/clang-api-for-parsing-c-code