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
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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100104/dd098d78/attachment.html>
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 > >
Hello> Am I doing something wrong?Yes> Operating system: Ubuntu 9.04 > LLVM was obtained with: apt-get install llvmConsider checking out code from svn or at least use package for LLVM 2.6 release (as I can see, 9.04 has only 2.5) -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Right, it works with 2.6, thanks. On Mon, Jan 4, 2010 at 10:45 AM, Anton Korobeynikov <anton at korobeynikov.info> wrote:> Hello > >> Am I doing something wrong? > Yes > >> Operating system: Ubuntu 9.04 >> LLVM was obtained with: apt-get install llvm > Consider checking out code from svn or at least use package for LLVM > 2.6 release (as I can see, 9.04 has only 2.5) > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University >
Reasonably Related Threads
- [LLVMdev] Getting Kaleidoscope to compile
- [LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
- [LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
- [LLVMdev] Help with Mac OS X 10.6.2 build
- [LLVMdev] Getting Kaleidoscope to compile