[LLVMdev] Getting Kaleidoscope to compile

Russell Wallace russell.wallace at gmail.com
Mon Jan 4 02:37:11 PST 2010


I tried apt-get install llvm-dev just now, and it says it was already
installed, and when I again try compiling toy.cpp, it gives the same
set of error messages.

On Mon, Jan 4, 2010 at 10:27 AM, Oleg Knut <oleg77 at gmail.com> wrote:
> Probably you missed to install llvm-dev package with headers for llvm.
>
> 2010/1/4 Russell Wallace <russell.wallace at gmail.com>
>>
>> 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
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>




More information about the llvm-dev mailing list