How to compile with llvm and g ++?

I am using fedora-11 system and recently I installed llvm ( sudo yum -y install llvm llvm-docs llvm-devel). When I search llvm, I get them in /usr/bin. Some links to binary files are broken ( llvm-gcc, llvm-g++, llvm-cppetc.). Include files are inside /usr/include/llvmand libs on /usr/lib/llvm. How to compile them with g++? I tried to compile the kaleidoscope code specified in the tutorial as directed, but it does not compile.

I get this:

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

I can not find the file LLVMContext.h. Therefore, I assume that this may be a version issue. What should I do to make it work?

Some help would be good! thanks in advance...:)

+3
2

, , . llvm.org svn . , .

0

yum clang/llvm, this .

0

Source: https://habr.com/ru/post/1739582/


All Articles