I'm trying to generate LLVM IR code, which I have done successfully as part of the Kaleidoscope tutorial on this same machine, using these same compiler flags.
My code compiles without errors in clang++ 3.4. However, at link time I'm getting:
undefined reference to `llvm::Value::dump() const'
The error is being triggered by the line:
if (generator.code()) // returns llvm::Function*, or NULL
generator.code()->dump();
If I remove the call to dump()
, the linker is happy.
Clang++ flags I'm using are:
-O3 -g -Wall -std=c++11 -I./src `llvm-config --cppflags --ldflags --libs core jit native`
I'm confused, because the Kaleidoscope project compiles and runs fine and uses the same compiler flags and is built on the same computer.