LibClang
Page Contents
References
- Using libclang to Parse C++ (aka libclang 101), Shahar Mike.
- Traversing the AST with cursors, Clang Docs.
Getting LibClang & Linking Against It
To install LibClang on Ubuntu is super easy:
sudo apt install libclang-9-dev
To link against it is just as easy:
CLANG_INC_DIR=/usr/lib/llvm-9/include CLANG_LIB_DIR=/usr/lib/llvm-9/lib LDLIBS=-lclang -lstdc++ LOADLIBES=-L$(CLANG_LIB_DIR) CXXFLAGS+=-I$(CLANG_INC_DIR)