Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LLVM references a header which does not exist

Tags:

c++

llvm

I've downloaded LLVM and Clang from SVN, built them, and written a tiny sample program. However, the LLVM headers (llvm/support/type_traits.h) appear to include another LLVM header, llvm/support/DataTypes.h, which does not exist. I checked the documentation on the LLVM website and they don't seem to think it should exist either.

How can I fix this issue?

like image 426
Puppy Avatar asked Dec 18 '12 11:12

Puppy


Video Answer


1 Answers

Some file are auto-generated into the build directory. When compiling your programs to use LLVM as a library, always use the llvm-config tool to provide you with the right header directories and library directories for linking. I have this in my Makefile:

LLVM_CONFIG_COMMAND = `$(LLVM_BIN_PATH)/llvm-config --cxxflags --libs` \
                      `$(LLVM_BIN_PATH)/llvm-config --ldflags`

And I use it on the compiler command-line.

LLVM_BIN_PATH = $(LLVM_BUILD_PATH)/Debug+Asserts/bin

Where LLVM_BUILD_PATH is the path where you ran configure, and the rest of it depends on which version you have built (I usually use the Debug+Asserts one for hacking inside LLVM).

like image 185
Eli Bendersky Avatar answered Oct 27 '22 14:10

Eli Bendersky