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?
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With