簡體   English   中英

如何用llvm和g ++編譯?

[英]how to compile with llvm and g++?

我使用fedora-11系統,最近我安裝了llvm( sudo yum -y install llvm llvm-docs llvm-devel )。 當我搜索llvm時,我將它們放在/usr/bin 二進制文件的一些鏈接被破壞( llvm-gccllvm-g++llvm-cpp等)。 包含文件位於/usr/include/llvm ,libs位於/usr/lib/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文件。 所以我想這可能是一個版本問題。 我該怎么做才能讓它發揮作用?

一些幫助會很好! 提前致謝... :)

而不是用yum的,按照安裝鐺/ LLVM ,或鏈接。

看起來未安裝標頭或安裝在您未使用的路徑中。 我的建議是從llvm.org網站或svn下載代碼並使用它來構建Kaleidoscope示例。 它非常簡單,所有代碼都在examples目錄中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM