2010-04-02 85 views
3

我使用的是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文件了。所以我想這可能是一個版本問題。 我該怎麼做才能使它工作?

有些幫助會很好!在此先感謝... :)

+0

Fedora 11是很舊的東西,我會建議你自己升級你的操作系統。 Fedora 18已經出來了,它的軟件包對我來說還是很重要的。 – rubenvb 2013-02-12 10:48:37

回答

0

看起來像標題未安裝或安裝在您不使用的路徑。我的建議是從llvm.org網站或svn下載代碼,並使用它來構建萬花筒示例。這很簡單,所有代碼都在示例目錄中。