2013-08-19 26 views
0

我想從LLVM示例構建ModuleMaker。如何使用鐺++構建llvm示例的ModuleMaker ++

當我調用:

clang++ -g ModuleMaker.cpp `llvm-config --cppflags --ldflags --libs core jit native` -o ModuleMaker 

我收到錯誤消息:

/home/huangered/Desktop/ModuleMaker/main.cpp:59: undefined reference to `llvm::WriteBitcodeToFile(llvm::Module const*, llvm::raw_ostream&)' 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

我該如何解決這個問題?

回答

0
clang++ main.cpp `llvm-config --cppflags --ldflags --libs core jit native bitwriter` -o main 

o.i得到它。我應該在llvm-config中添加一個bitwriter組件。