我使用的是fedora-11系统,最近我安装了llvm(sudo yum -y install llvm llvm-docs llvm-devel
)。 当我搜索llvm时,我得到它们在/usr/bin
。一些链接的二进制文件被破坏(llvm-gcc
,llvm-g++
,llvm-cpp
等)。包含文件位于/usr/include/llvm
之内,库位在/usr/lib/llvm
之内。如何使用g++
编译它们?我试图按照指示编译tutorial中给出的万花筒代码,但它无法编译。如何用llvm和g ++编译?
我得到这个:
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
我找不到LLVMContext.h
文件了。所以我想这可能是一个版本问题。 我该怎么做才能使它工作?
有些帮助会很好!在此先感谢... :)
Fedora 11是很旧的东西,我会建议你自己升级你的操作系统。 Fedora 18已经出来了,它的软件包对我来说还是很重要的。 – rubenvb 2013-02-12 10:48:37