Error: ASTConsumer.h not found

Viewed 1384
1 Answers

I was getting the same error and I fixed it by installing the libclang-dev library for the version of clang/llvm I was using.

On Linux with LLVM version 5.0 that was (not sure what the command is on a mac - sorry):

sudo apt-get install libclang-5.0-dev

Note that the documentation suggests that these examples are designed to be run with a version of llvm/clang that you have built from source (either by downloading a tarred release or cloning the llvm repository). I was able to get them to build exclusively from a version of LLVM and Clang I installed via my package manager. I had to set the configuration variables for the Makefile as follows:

CXX := /usr/bin/clang++
LLVM_SRC_PATH := /usr/lib/llvm-5.0
LLVM_BUILD_PATH := /usr/lib/llvm-5.0/build
LLVM_BIN_PATH := /usr/lib/llvm-5.0/bin

Again, it's probably a little different on a mac, but hopefully this can help point you in the right direction.

Related