[LLVMdev] Getting Kaleidoscope to compile

Russell Wallace russell.wallace at gmail.com
Mon Jan 4 02:19:59 PST 2010


Hi all,

I've started work on a new programming language for which I am
considering using LLVM as the backend,  and trying to experiment with
it using the Kaleidoscope demo compiler.

Taking the full source listing from
http://llvm.org/docs/tutorial/LangImpl3.html#code and trying to
compile it with the provided instructions gives me the following
errors:

a at a-desktop:~$ g++ -g -O3 toy.cpp `llvm-config --cppflags --ldflags
--libs core` -o toy
toy.cpp:5:30: error: llvm/LLVMContext.h: No such file or directory
toy.cpp:352: error: ‘getGlobalContext’ was not declared in this scope
toy.cpp: In member function ‘virtual llvm::Value* NumberExprAST::Codegen()’:
toy.cpp:358: error: ‘getGlobalContext’ was not declared in this scope
toy.cpp: In member function ‘virtual llvm::Value* BinaryExprAST::Codegen()’:
toy.cpp:379: error: ‘getDoubleTy’ is not a member of ‘llvm::Type’
toy.cpp:379: error: ‘getGlobalContext’ was not declared in this scope
toy.cpp: In member function ‘llvm::Function* PrototypeAST::Codegen()’:
toy.cpp:407: error: ‘getDoubleTy’ is not a member of ‘llvm::Type’
toy.cpp:407: error: ‘getGlobalContext’ was not declared in this scope
toy.cpp:408: error: ‘getDoubleTy’ is not a member of ‘llvm::Type’
toy.cpp: In member function ‘llvm::Function* FunctionAST::Codegen()’:
toy.cpp:454: error: ‘getGlobalContext’ was not declared in this scope
toy.cpp: In function ‘int main()’:
toy.cpp:543: error: ‘LLVMContext’ was not declared in this scope
toy.cpp:543: error: ‘Context’ was not declared in this scope
toy.cpp:543: error: ‘getGlobalContext’ was not declared in this scope

Am I doing something wrong?

Operating system: Ubuntu 9.04
LLVM was obtained with: apt-get install llvm




More information about the llvm-dev mailing list