clang API for parsing C++ code

旧街凉风 提交于 2019-12-25 02:25:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!