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: ‘getGlobalContextwas not declared in this scope

toy.cpp: In member functionvirtual llvm::Value* NumberExprAST::Codegen()’:

toy.cpp:358: error: ‘getGlobalContextwas not declared in this scope

toy.cpp: In member functionvirtual llvm::Value* BinaryExprAST::Codegen()’:

toy.cpp:379: error: ‘getDoubleTyis not a member ofllvm::Typetoy.cpp:379: error: ‘getGlobalContextwas not declared in this scope

toy.cpp: In member functionllvm::Function* PrototypeAST::Codegen()’:

toy.cpp:407: error: ‘getDoubleTyis not a member ofllvm::Typetoy.cpp:407: error: ‘getGlobalContextwas not declared in this scope

toy.cpp:408: error: ‘getDoubleTyis not a member ofllvm::Typetoy.cpp: In member functionllvm::Function* FunctionAST::Codegen()’:

toy.cpp:454: error: ‘getGlobalContextwas not declared in this scope

toy.cpp: In functionint main()’:

toy.cpp:543: error: ‘LLVMContextwas not declared in this scope

toy.cpp:543: error: ‘Contextwas not declared in this scope

toy.cpp:543: error: ‘getGlobalContextwas 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