I tried to use clang to parse C ++ code but could not compile the source code because I cannot find the libclang headers.
I am running ubuntu 10.04 and successfully installed clang and llvm from the repositories.
Please tell me where to find the file to include.
An example I'm trying to run:
#include<clang-c/Index.h> int main(int argc, char *argv[]) { CXIndex Index = clang_createIndex(0, 0); CXTranslationUnit TU = clang_parseTranslationUnit(Index, 0,argv, argc, 0, 0, CXTranslationUnit_None); for (unsigned I = 0, N = clang_getNumDiagnostics(TU); I != N; ++I) { CXDiagnostic Diag = clang_getDiagnostic(TU, I); CXString String = clang_formatDiagnostic(Diag, clang_defaultDiagnosticDisplayOptions()); fprintf(stderr, "%s\n", clang_getCString(String)); clang_disposeString(String); } clang_disposeTranslationUnit(TU); clang_disposeIndex(Index); return 0; }
source share