[cfe-dev] 转发: 回复: [cfe-dev] Fail to compile clang-wpa.cpp

kobe James god.son2046 at yahoo.com.cn
Sat Apr 23 18:46:28 PDT 2011





----- 转发邮件 ----
发件人: kobe James <god.son2046 at yahoo.com.cn>
收件人: arrowdodger <6yearold at gmail.com>
发送日期: 2011/4/23 (周六) 9:45:28 下午
主   题: 回复: [cfe-dev] Fail to compile clang-wpa.cpp




Thanks. 
I have changed the command to 

clang++ -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS clang-wpa.cpp -o 
clang-wpa

And I got the following errors:
/tmp/cc-NNmY0D.o: In function `main':
clang-wpa.cpp:(.text+0x1fd): undefined reference to 
`llvm::cl::ParseCommandLineOptions(int, char**, char const*, bool)'
clang-wpa.cpp:(.text+0x20f): undefined reference to 
`clang::idx::Program::Program()'
clang-wpa.cpp:(.text+0x2e2): undefined reference to 
`clang::CompilerInstance::createDiagnostics(clang::DiagnosticOptions const&, 
int, char const* const*, clang::DiagnosticClient*, clang::CodeGenOptions 
const*)'
clang-wpa.cpp:(.text+0x3c2): undefined reference to  
`clang::ASTUnit::LoadFromASTFile(std::string const&, 
llvm::IntrusiveRefCntPtr<clang::Diagnostic>, clang::FileSystemOptions const&, 
bool, std::pair<std::string, llvm::PointerUnion<char const*, llvm::MemoryBuffer 
const*> >*, unsigned int, bool)'
clang-wpa.cpp:(.text+0x5df): undefined reference to 
`clang::CallGraph::CallGraph(clang::idx::Program&)'
clang-wpa.cpp:(.text+0x69d): undefined reference to 
`clang::CallGraph::addTU(clang::ASTContext&)'
clang-wpa.cpp:(.text+0x718): undefined reference to 
`clang::CallGraph::ViewCallGraph() const'
clang-wpa.cpp:(.text+0x84f): undefined reference to 
`clang::idx::Indexer::IndexAST(clang::idx::TranslationUnit*)'
clang-wpa.cpp:(.text+0x8bb): undefined reference to 
`clang::idx::Entity::get(llvm::StringRef, clang::idx::Program&)'
clang-wpa.cpp:(.text+0x934): undefined reference to  
`clang::idx::Indexer::getDefinitionFor(clang::idx::Entity)'
clang-wpa.cpp:(.text+0xe5d): undefined reference to 
`clang::ento::registerCheckers(clang::AnalyzerOptions const&, clang::LangOptions 
const&, clang::Diagnostic&)'
clang-wpa.cpp:(.text+0xfe3): undefined reference to 
`clang::ento::CreateRangeConstraintManager(clang::ento::GRStateManager&, 
clang::ento::SubEngine&)'
clang-wpa.cpp:(.text+0xff3): undefined reference to 
`clang::ento::CreateRegionStoreManager(clang::ento::GRStateManager&)'
clang-wpa.cpp:(.text+0x1057): undefined reference to 
`clang::ento::MakeCFRefCountTF(clang::ASTContext&, bool, clang::LangOptions 
const&)'
clang-wpa.cpp:(.text+0x1087): undefined reference to 
`clang::ento::ExprEngine::ExprEngine(clang::ento::AnalysisManager&, 
clang::ento::TransferFuncs*)'
clang-wpa.cpp:(.text+0x1112): undefined reference to 
`clang::ento::ExprEngine::~ExprEngine()'
clang-wpa.cpp:(.text+0x1165):  undefined reference to 
`clang::ento::ExprEngine::~ExprEngine()'
clang-wpa.cpp:(.text+0x1256): undefined reference to 
`clang::idx::Program::~Program()'
clang-wpa.cpp:(.text+0x1298): undefined reference to 
`clang::idx::Program::~Program()'
/tmp/cc-NNmY0D.o: In function `(anonymous 
namespace)::ASTUnitTU::ASTUnitTU(clang::ASTUnit*)':
clang-wpa.cpp:(.text+0x13da): undefined reference to 
`clang::idx::DeclReferenceMap::DeclReferenceMap(clang::ASTContext&)'
clang-wpa.cpp:(.text+0x1412): undefined reference to 
`clang::idx::SelectorMap::SelectorMap(clang::ASTContext&)'
clang-wpa.cpp:(.text+0x145c): undefined reference to 
`clang::idx::TranslationUnit::~TranslationUnit()'
/tmp/cc-NNmY0D.o: In function `(anonymous namespace)::ASTUnitTU::~ASTUnitTU()':
clang-wpa.cpp:(.text+0x15c7): undefined reference to 
`clang::idx::TranslationUnit::~TranslationUnit()'
clang-wpa.cpp:(.text+0x160c): undefined reference to  
`clang::idx::TranslationUnit::~TranslationUnit()'
/tmp/cc-NNmY0D.o: In function 
`llvm::OwningPtr<clang::CallGraph>::reset(clang::CallGraph*)':
clang-wpa.cpp:(.text._ZN4llvm9OwningPtrIN5clang9CallGraphEE5resetEPS2_[_ZN4llvm9OwningPtrIN5clang9CallGraphEE5resetEPS2_]+0x56):
 undefined reference to `clang::CallGraph::~CallGraph()'
/tmp/cc-NNmY0D.o: In function `llvm::Triple::getOS() const':
clang-wpa.cpp:(.text._ZNK4llvm6Triple5getOSEv[_ZNK4llvm6Triple5getOSEv]+0x28): 
undefined reference to `llvm::Triple::Parse() const'
/tmp/cc-NNmY0D.o: In function `llvm::Triple::getVendor() const':
clang-wpa.cpp:(.text._ZNK4llvm6Triple9getVendorEv[_ZNK4llvm6Triple9getVendorEv]+0x28):
 undefined reference to `llvm::Triple::Parse() const'
/tmp/cc-NNmY0D.o: In function  
`llvm::OwningPtr<clang::ento::CheckerManager>::reset(clang::ento::CheckerManager*)':

clang-wpa.cpp:(.text._ZN4llvm9OwningPtrIN5clang4ento14CheckerManagerEE5resetEPS3_[_ZN4llvm9OwningPtrIN5clang4ento14CheckerManagerEE5resetEPS3_]+0x56):
 undefined reference to `clang::ento::CheckerManager::~CheckerManager()'
/tmp/cc-NNmY0D.o: In function 
`clang::ento::ExprEngine::ExecuteWorkList(clang::LocationContext const*, 
unsigned int)':
clang-wpa.cpp:(.text._ZN5clang4ento10ExprEngine15ExecuteWorkListEPKNS_15LocationContextEj[_ZN5clang4ento10ExprEngine15ExecuteWorkListEPKNS_15LocationContextEj]+0x38):
 undefined reference to 
`clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*, 
unsigned int, clang::ento::GRState const*)'
/tmp/cc-NNmY0D.o: In function 
`clang::ento::AnalysisManager::getStackFrame(clang::Decl const*,  
clang::idx::TranslationUnit*)':
clang-wpa.cpp:(.text._ZN5clang4ento15AnalysisManager13getStackFrameEPKNS_4DeclEPNS_3idx15TranslationUnitE[_ZN5clang4ento15AnalysisManager13getStackFrameEPKNS_4DeclEPNS_3idx15TranslationUnitE]+0x5b):
 undefined reference to `clang::AnalysisContextManager::getContext(clang::Decl 
const*, clang::idx::TranslationUnit*)'
clang-wpa.cpp:(.text._ZN5clang4ento15AnalysisManager13getStackFrameEPKNS_4DeclEPNS_3idx15TranslationUnitE[_ZN5clang4ento15AnalysisManager13getStackFrameEPKNS_4DeclEPNS_3idx15TranslationUnitE]+0x77):
 undefined reference to 
`clang::LocationContextManager::getStackFrame(clang::AnalysisContext*, 
clang::LocationContext const*, clang::Stmt const*, clang::CFGBlock const*, 
unsigned int)'
/tmp/cc-NNmY0D.o: In function  
`llvm::OwningPtr<clang::ento::CheckerManager>::~OwningPtr()':
clang-wpa.cpp:(.text._ZN4llvm9OwningPtrIN5clang4ento14CheckerManagerEED2Ev[_ZN4llvm9OwningPtrIN5clang4ento14CheckerManagerEED2Ev]+0x29):
 undefined reference to `clang::ento::CheckerManager::~CheckerManager()'
/tmp/cc-NNmY0D.o: In function `llvm::OwningPtr<clang::CallGraph>::~OwningPtr()':
clang-wpa.cpp:(.text._ZN4llvm9OwningPtrIN5clang9CallGraphEED2Ev[_ZN4llvm9OwningPtrIN5clang9CallGraphEED2Ev]+0x29):
 undefined reference to `clang::CallGraph::~CallGraph()'
/tmp/cc-NNmY0D.o: In function `llvm::OwningPtr<clang::ASTUnit>::~OwningPtr()':
clang-wpa.cpp:(.text._ZN4llvm9OwningPtrIN5clang7ASTUnitEED2Ev[_ZN4llvm9OwningPtrIN5clang7ASTUnitEED2Ev]+0x29):
 undefined reference to `clang::ASTUnit::~ASTUnit()'
/tmp/cc-NNmY0D.o: In function 
`llvm::RefCountedBase<clang::Diagnostic>::Release()  const':
clang-wpa.cpp:(.text._ZNK4llvm14RefCountedBaseIN5clang10DiagnosticEE7ReleaseEv[_ZNK4llvm14RefCountedBaseIN5clang10DiagnosticEE7ReleaseEv]+0x7a):
 undefined reference to `clang::Diagnostic::~Diagnostic()'
/tmp/cc-NNmY0D.o: In function `llvm::cl::opt<std::string, false, 
llvm::cl::parser<std::string> >::opt<char [17], llvm::cl::desc>(char const (&) 
[17], llvm::cl::desc const&)':
clang-wpa.cpp:(.text._ZN4llvm2cl3optISsLb0ENS0_6parserISsEEEC2IA17_cNS0_4descEEERKT_RKT0_[_ZN4llvm2cl3optISsLb0ENS0_6parserISsEEEC2IA17_cNS0_4descEEERKT_RKT0_]+0x42):
 undefined reference to `vtable for llvm::cl::opt<std::string, false, 
llvm::cl::parser<std::string> >'
clang-wpa.cpp:(.text._ZN4llvm2cl3optISsLb0ENS0_6parserISsEEEC2IA17_cNS0_4descEEERKT_RKT0_[_ZN4llvm2cl3optISsLb0ENS0_6parserISsEEEC2IA17_cNS0_4descEEERKT_RKT0_]+0x78):
 undefined reference to `llvm::cl::opt<std::string, false,  
llvm::cl::parser<std::string> >::done()'
/tmp/cc-NNmY0D.o: In function `llvm::cl::Option::Option(unsigned int)':
clang-wpa.cpp:(.text._ZN4llvm2cl6OptionC2Ej[_ZN4llvm2cl6OptionC2Ej]+0x14): 
undefined reference to `vtable for llvm::cl::Option'
/tmp/cc-NNmY0D.o: In function `llvm::cl::Option::~Option()':
clang-wpa.cpp:(.text._ZN4llvm2cl6OptionD2Ev[_ZN4llvm2cl6OptionD2Ev]+0x4): 
undefined reference to `vtable for llvm::cl::Option'
/tmp/cc-NNmY0D.o: In function `llvm::cl::parser<std::string>::~parser()':
clang-wpa.cpp:(.text._ZN4llvm2cl6parserISsED2Ev[_ZN4llvm2cl6parserISsED2Ev]+0xc):
 undefined reference to `vtable for llvm::cl::parser<std::string>'
/tmp/cc-NNmY0D.o: In function 
`llvm::cl::basic_parser<std::string>::~basic_parser()':
clang-wpa.cpp:(.text._ZN4llvm2cl12basic_parserISsED2Ev[_ZN4llvm2cl12basic_parserISsED2Ev]+0xc):
 undefined reference to `vtable for  llvm::cl::basic_parser<std::string>'
/tmp/cc-NNmY0D.o: In function 
`llvm::cl::basic_parser_impl::~basic_parser_impl()':
clang-wpa.cpp:(.text._ZN4llvm2cl17basic_parser_implD2Ev[_ZN4llvm2cl17basic_parser_implD2Ev]+0x4):
 undefined reference to `vtable for llvm::cl::basic_parser_impl'
/tmp/cc-NNmY0D.o: In function `llvm::cl::parser<std::string>::parser()':
clang-wpa.cpp:(.text._ZN4llvm2cl6parserISsEC2Ev[_ZN4llvm2cl6parserISsEC2Ev]+0xc):
 undefined reference to `vtable for llvm::cl::parser<std::string>'
/tmp/cc-NNmY0D.o: In function 
`llvm::cl::basic_parser<std::string>::basic_parser()':
clang-wpa.cpp:(.text._ZN4llvm2cl12basic_parserISsEC2Ev[_ZN4llvm2cl12basic_parserISsEC2Ev]+0xc):
 undefined reference to `vtable for llvm::cl::basic_parser<std::string>'
/tmp/cc-NNmY0D.o: In function  
`llvm::cl::basic_parser_impl::basic_parser_impl()':
clang-wpa.cpp:(.text._ZN4llvm2cl17basic_parser_implC2Ev[_ZN4llvm2cl17basic_parser_implC2Ev]+0x4):
 undefined reference to `vtable for llvm::cl::basic_parser_impl'
/tmp/cc-NNmY0D.o: In function `llvm::cl::opt<bool, false, llvm::cl::parser<bool> 
>::opt<char [16], llvm::cl::desc>(char const (&) [16], llvm::cl::desc const&)':
clang-wpa.cpp:(.text._ZN4llvm2cl3optIbLb0ENS0_6parserIbEEEC2IA16_cNS0_4descEEERKT_RKT0_[_ZN4llvm2cl3optIbLb0ENS0_6parserIbEEEC2IA16_cNS0_4descEEERKT_RKT0_]+0x42):
 undefined reference to `vtable for llvm::cl::opt<bool, false, 
llvm::cl::parser<bool> >'
clang-wpa.cpp:(.text._ZN4llvm2cl3optIbLb0ENS0_6parserIbEEEC2IA16_cNS0_4descEEERKT_RKT0_[_ZN4llvm2cl3optIbLb0ENS0_6parserIbEEEC2IA16_cNS0_4descEEERKT_RKT0_]+0x78):
 undefined reference to `llvm::cl::opt<bool, false, llvm::cl::parser<bool> 
>::done()'
/tmp/cc-NNmY0D.o: In  function `llvm::cl::parser<bool>::~parser()':
clang-wpa.cpp:(.text._ZN4llvm2cl6parserIbED2Ev[_ZN4llvm2cl6parserIbED2Ev]+0xc): 
undefined reference to `vtable for llvm::cl::parser<bool>'
/tmp/cc-NNmY0D.o: In function `llvm::cl::basic_parser<bool>::~basic_parser()':
clang-wpa.cpp:(.text._ZN4llvm2cl12basic_parserIbED2Ev[_ZN4llvm2cl12basic_parserIbED2Ev]+0xc):
 undefined reference to `vtable for llvm::cl::basic_parser<bool>'
/tmp/cc-NNmY0D.o: In function `llvm::cl::parser<bool>::parser()':
clang-wpa.cpp:(.text._ZN4llvm2cl6parserIbEC2Ev[_ZN4llvm2cl6parserIbEC2Ev]+0xc): 
undefined reference to `vtable for llvm::cl::parser<bool>'
/tmp/cc-NNmY0D.o: In function `llvm::cl::basic_parser<bool>::basic_parser()':
clang-wpa.cpp:(.text._ZN4llvm2cl12basic_parserIbEC2Ev[_ZN4llvm2cl12basic_parserIbEC2Ev]+0xc):
 undefined reference to `vtable for llvm::cl::basic_parser<bool>'
/tmp/cc-NNmY0D.o: In function  `llvm::cl::list<std::string, bool, 
llvm::cl::parser<std::string> >::done()':
clang-wpa.cpp:(.text._ZN4llvm2cl4listISsbNS0_6parserISsEEE4doneEv[_ZN4llvm2cl4listISsbNS0_6parserISsEEE4doneEv]+0x15):
 undefined reference to `llvm::cl::Option::addArgument()'
/tmp/cc-NNmY0D.o: In function `llvm::cl::list<std::string, bool, 
llvm::cl::parser<std::string> >::getOptionWidth() const':
clang-wpa.cpp:(.text._ZNK4llvm2cl4listISsbNS0_6parserISsEEE14getOptionWidthEv[_ZNK4llvm2cl4listISsbNS0_6parserISsEEE14getOptionWidthEv]+0x23):
 undefined reference to 
`llvm::cl::basic_parser_impl::getOptionWidth(llvm::cl::Option const&) const'
/tmp/cc-NNmY0D.o: In function `llvm::cl::list<std::string, bool, 
llvm::cl::parser<std::string> >::printOptionInfo(unsigned long) const':
clang-wpa.cpp:(.text._ZNK4llvm2cl4listISsbNS0_6parserISsEEE15printOptionInfoEm[_ZNK4llvm2cl4listISsbNS0_6parserISsEEE15printOptionInfoEm]+0x33):
 undefined  reference to 
`llvm::cl::basic_parser_impl::printOptionInfo(llvm::cl::Option const&, unsigned 
long) const'
/tmp/cc-NNmY0D.o: In function `clang::idx::Indexer::~Indexer()':
clang-wpa.cpp:(.text._ZN5clang3idx7IndexerD2Ev[_ZN5clang3idx7IndexerD2Ev]+0xf): 
undefined reference to `vtable for clang::idx::Indexer'
clang-wpa.cpp:(.text._ZN5clang3idx7IndexerD2Ev[_ZN5clang3idx7IndexerD2Ev]+0x6e): 
undefined reference to `clang::idx::IndexProvider::~IndexProvider()'
clang-wpa.cpp:(.text._ZN5clang3idx7IndexerD2Ev[_ZN5clang3idx7IndexerD2Ev]+0x10b):
 undefined reference to `clang::idx::IndexProvider::~IndexProvider()'
/tmp/cc-NNmY0D.o: In function `llvm::SmallPtrSet<clang::idx::TranslationUnit*, 
4u>::~SmallPtrSet()':
clang-wpa.cpp:(.text._ZN4llvm11SmallPtrSetIPN5clang3idx15TranslationUnitELj4EED2Ev[_ZN4llvm11SmallPtrSetIPN5clang3idx15TranslationUnitELj4EED2Ev]+0x11):
 undefined reference to  `llvm::SmallPtrSetImpl::~SmallPtrSetImpl()'
/tmp/cc-NNmY0D.o: In function 
`clang::ento::AnalysisManager::~AnalysisManager()':
clang-wpa.cpp:(.text._ZN5clang4ento15AnalysisManagerD2Ev[_ZN5clang4ento15AnalysisManagerD2Ev]+0x44):
 undefined reference to 
`clang::LocationContextManager::~LocationContextManager()'
clang-wpa.cpp:(.text._ZN5clang4ento15AnalysisManagerD2Ev[_ZN5clang4ento15AnalysisManagerD2Ev]+0x56):
 undefined reference to 
`clang::AnalysisContextManager::~AnalysisContextManager()'
clang-wpa.cpp:(.text._ZN5clang4ento15AnalysisManagerD2Ev[_ZN5clang4ento15AnalysisManagerD2Ev]+0x67):
 undefined reference to `clang::ento::BugReporterData::~BugReporterData()'
clang-wpa.cpp:(.text._ZN5clang4ento15AnalysisManagerD2Ev[_ZN5clang4ento15AnalysisManagerD2Ev]+0xca):
 undefined reference to  
`clang::LocationContextManager::~LocationContextManager()'
clang-wpa.cpp:(.text._ZN5clang4ento15AnalysisManagerD2Ev[_ZN5clang4ento15AnalysisManagerD2Ev]+0xf6):
 undefined reference to 
`clang::AnalysisContextManager::~AnalysisContextManager()'
clang-wpa.cpp:(.text._ZN5clang4ento15AnalysisManagerD2Ev[_ZN5clang4ento15AnalysisManagerD2Ev]+0x104):
 undefined reference to `clang::ento::BugReporterData::~BugReporterData()'
/tmp/cc-NNmY0D.o: In function 
`clang::ento::AnalysisManager::AnalysisManager(clang::ASTContext&, 
clang::Diagnostic&, clang::LangOptions const&, 
clang::ento::PathDiagnosticClient*, clang::ento::StoreManager* 
(*)(clang::ento::GRStateManager&), clang::ento::ConstraintManager* 
(*)(clang::ento::GRStateManager&, clang::ento::SubEngine&), 
clang::ento::CheckerManager*, clang::idx::Indexer*, unsigned int, unsigned int, 
bool, bool, bool, bool, bool, bool, bool, bool, bool,  bool)':
clang-wpa.cpp:(.text._ZN5clang4ento15AnalysisManagerC2ERNS_10ASTContextERNS_10DiagnosticERKNS_11LangOptionsEPNS0_20PathDiagnosticClientEPFPNS0_12StoreManagerERNS0_14GRStateManagerEEPFPNS0_17ConstraintManagerESE_RNS0_9SubEngineEEPNS0_14CheckerManagerEPNS_3idx7IndexerEjjbbbbbbbbbb[_ZN5clang4ento15AnalysisManagerC2ERNS_10ASTContextERNS_10DiagnosticERKNS_11LangOptionsEPNS0_20PathDiagnosticClientEPFPNS0_12StoreManagerERNS0_14GRStateManagerEEPFPNS0_17ConstraintManagerESE_RNS0_9SubEngineEEPNS0_14CheckerManagerEPNS_3idx7IndexerEjjbbbbbbbbbb]+0x2f5):
 undefined reference to  
`clang::LocationContextManager::~LocationContextManager()'
clang-wpa.cpp:(.text._ZN5clang4ento15AnalysisManagerC2ERNS_10ASTContextERNS_10DiagnosticERKNS_11LangOptionsEPNS0_20PathDiagnosticClientEPFPNS0_12StoreManagerERNS0_14GRStateManagerEEPFPNS0_17ConstraintManagerESE_RNS0_9SubEngineEEPNS0_14CheckerManagerEPNS_3idx7IndexerEjjbbbbbbbbbb[_ZN5clang4ento15AnalysisManagerC2ERNS_10ASTContextERNS_10DiagnosticERKNS_11LangOptionsEPNS0_20PathDiagnosticClientEPFPNS0_12StoreManagerERNS0_14GRStateManagerEEPFPNS0_17ConstraintManagerESE_RNS0_9SubEngineEEPNS0_14CheckerManagerEPNS_3idx7IndexerEjjbbbbbbbbbb]+0x30a):
 undefined reference to  
`clang::AnalysisContextManager::~AnalysisContextManager()'
clang-wpa.cpp:(.text._ZN5clang4ento15AnalysisManagerC2ERNS_10ASTContextERNS_10DiagnosticERKNS_11LangOptionsEPNS0_20PathDiagnosticClientEPFPNS0_12StoreManagerERNS0_14GRStateManagerEEPFPNS0_17ConstraintManagerESE_RNS0_9SubEngineEEPNS0_14CheckerManagerEPNS_3idx7IndexerEjjbbbbbbbbbb[_ZN5clang4ento15AnalysisManagerC2ERNS_10ASTContextERNS_10DiagnosticERKNS_11LangOptionsEPNS0_20PathDiagnosticClientEPFPNS0_12StoreManagerERNS0_14GRStateManagerEEPFPNS0_17ConstraintManagerESE_RNS0_9SubEngineEEPNS0_14CheckerManagerEPNS_3idx7IndexerEjjbbbbbbbbbb]+0x31b):
 undefined reference to `clang::ento::BugReporterData::~BugReporterData()'
/tmp/cc-NNmY0D.o: In function `clang::ento::BugReporterData::BugReporterData()':
clang-wpa.cpp:(.text._ZN5clang4ento15BugReporterDataC2Ev[_ZN5clang4ento15BugReporterDataC2Ev]+0x4):
 undefined reference to `vtable for clang::ento::BugReporterData'
/tmp/cc-NNmY0D.o: In  function 
`llvm::FoldingSet<clang::LocationContext>::FoldingSet(unsigned int)':
clang-wpa.cpp:(.text._ZN4llvm10FoldingSetIN5clang15LocationContextEEC2Ej[_ZN4llvm10FoldingSetIN5clang15LocationContextEEC2Ej]+0x2d):
 undefined reference to `llvm::FoldingSetImpl::FoldingSetImpl(unsigned int)'
/tmp/cc-NNmY0D.o: In function 
`llvm::DefaultFoldingSetTrait<clang::LocationContext>::ComputeHash(clang::LocationContext&,
 llvm::FoldingSetNodeID&)':
clang-wpa.cpp:(.text._ZN4llvm22DefaultFoldingSetTraitIN5clang15LocationContextEE11ComputeHashERS2_RNS_16FoldingSetNodeIDE[_ZN4llvm22DefaultFoldingSetTraitIN5clang15LocationContextEE11ComputeHashERS2_RNS_16FoldingSetNodeIDE]+0x22):
 undefined reference to `llvm::FoldingSetNodeID::ComputeHash() const'
/tmp/cc-NNmY0D.o: In function 
`llvm::DefaultFoldingSetTrait<clang::LocationContext>::Equals(clang::LocationContext&,
 llvm::FoldingSetNodeID const&,  llvm::FoldingSetNodeID&)':
clang-wpa.cpp:(.text._ZN4llvm22DefaultFoldingSetTraitIN5clang15LocationContextEE6EqualsERS2_RKNS_16FoldingSetNodeIDERS5_[_ZN4llvm22DefaultFoldingSetTraitIN5clang15LocationContextEE6EqualsERS2_RKNS_16FoldingSetNodeIDERS5_]+0x29):
 undefined reference to 
`llvm::FoldingSetNodeID::operator==(llvm::FoldingSetNodeID const&) const'
/tmp/cc-NNmY0D.o: In function 
`llvm::FoldingSet<clang::LocationContext>::~FoldingSet()':
clang-wpa.cpp:(.text._ZN4llvm10FoldingSetIN5clang15LocationContextEED2Ev[_ZN4llvm10FoldingSetIN5clang15LocationContextEED2Ev]+0x22):
 undefined reference to `llvm::FoldingSetImpl::~FoldingSetImpl()'
/tmp/cc-NNmY0D.o: In function `clang::idx::TranslationUnit::TranslationUnit()':
clang-wpa.cpp:(.text._ZN5clang3idx15TranslationUnitC2Ev[_ZN5clang3idx15TranslationUnitC2Ev]+0x4):
 undefined reference to `vtable for clang::idx::TranslationUnit'
/tmp/cc-NNmY0D.o: In function  
`clang::idx::Indexer::Indexer(clang::idx::Program&)':
clang-wpa.cpp:(.text._ZN5clang3idx7IndexerC2ERNS0_7ProgramE[_ZN5clang3idx7IndexerC2ERNS0_7ProgramE]+0x27):
 undefined reference to `vtable for clang::idx::Indexer'
clang-wpa.cpp:(.text._ZN5clang3idx7IndexerC2ERNS0_7ProgramE[_ZN5clang3idx7IndexerC2ERNS0_7ProgramE]+0x10b):
 undefined reference to `clang::idx::IndexProvider::~IndexProvider()'
/tmp/cc-NNmY0D.o: In function `clang::idx::IndexProvider::IndexProvider()':
clang-wpa.cpp:(.text._ZN5clang3idx13IndexProviderC2Ev[_ZN5clang3idx13IndexProviderC2Ev]+0x4):
 undefined reference to `vtable for clang::idx::IndexProvider'
/tmp/cc-NNmY0D.o: In function `llvm::cl::opt<std::string, false, 
llvm::cl::parser<std::string> >::~opt()':
clang-wpa.cpp:(.text._ZN4llvm2cl3optISsLb0ENS0_6parserISsEEED2Ev[_ZN4llvm2cl3optISsLb0ENS0_6parserISsEEED2Ev]+0xf):
 undefined reference to `vtable for llvm::cl::opt<std::string, false,  
llvm::cl::parser<std::string> >'
/tmp/cc-NNmY0D.o: In function `llvm::cl::opt<bool, false, llvm::cl::parser<bool> 
>::~opt()':
clang-wpa.cpp:(.text._ZN4llvm2cl3optIbLb0ENS0_6parserIbEEED2Ev[_ZN4llvm2cl3optIbLb0ENS0_6parserIbEEED2Ev]+0xf):
 undefined reference to `vtable for llvm::cl::opt<bool, false, 
llvm::cl::parser<bool> >'
/tmp/cc-NNmY0D.o:(.rodata._ZTVN4llvm2cl4listISsbNS0_6parserISsEEEE[_ZTVN4llvm2cl4listISsbNS0_6parserISsEEEE]+0x20):
 undefined reference to `llvm::cl::Option::anchor()'
/tmp/cc-NNmY0D.o:(.rodata._ZTIN4llvm2cl4listISsbNS0_6parserISsEEEE[_ZTIN4llvm2cl4listISsbNS0_6parserISsEEEE]+0x18):
 undefined reference to `typeinfo for llvm::cl::Option'
/tmp/cc-NNmY0D.o:(.rodata._ZTIN5clang4ento15AnalysisManagerE[_ZTIN5clang4ento15AnalysisManagerE]+0x10):
 undefined reference to `typeinfo for  clang::ento::BugReporterData'
/tmp/cc-NNmY0D.o:(.rodata._ZTIN4llvm10FoldingSetIN5clang15LocationContextEEE[_ZTIN4llvm10FoldingSetIN5clang15LocationContextEEE]+0x10):
 undefined reference to `typeinfo for llvm::FoldingSetImpl'
/tmp/cc-NNmY0D.o:(.rodata+0x80): undefined reference to `typeinfo for 
clang::idx::TranslationUnit'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
=======================================================

Could you help me figure out the what the problem is?

Best,
Chen


________________________________
发件人: arrowdodger <6yearold at gmail.com>
收件人: kobe James <god.son2046 at yahoo.com.cn>
抄   送: cfe-dev at cs.uiuc.edu
发送日期: 2011/4/23 (周六) 9:39:44 上午
主   题: Re: [cfe-dev] Fail to compile clang-wpa.cpp

On Sat, Apr 23, 2011 at 10:51 AM, kobe James <god.son2046 at yahoo.com.cn> wrote:

Hi,
>
>I installed Clang on my machine. It successed to compile a simple C file.
>
>Then I tried to compile the clang-wpa.cpp file but got the following errors:
>==============================
>In file included from clang-wpa.cpp:15:
>In file included from /usr/local/include/clang/Basic/FileManager.h:20:
>In file included from /usr/local/include/llvm/ADT/StringMap.h:18:
>In file included from /usr/local/include/llvm/Support/Allocator.h:18:
>In file included from /usr/local/include/llvm/Support/MathExtras.h:17:
>In file included from /usr/local/include/llvm/Support/SwapByteOrder.h:18:
>/usr/local/include/llvm/Support/DataTypes.h:45:3: error: #error "Must #define 
>__STDC_LIMIT_MACROS before #including System/DataTypes.h"
># error "Must #define __STDC_LIMIT_MACROS before  #including 
System/DataTypes.h"
>  ^
>/usr/local/include/llvm/Support/DataTypes.h:49:3: error: #error "Must #define 
>__STDC_CONSTANT_MACROS before " "#including System/DataTypes.h"
># error "Must #define __STDC_CONSTANT_MACROS before " \
>  ^
>In file included from clang-wpa.cpp:15:
>In file included from /usr/local/include/clang/Basic/FileManager.h:20:
>In file included from /usr/local/include/llvm/ADT/StringMap.h:18:
>In file included from /usr/local/include/llvm/Support/Allocator.h:18:
>/usr/local/include/llvm/Support/MathExtras.h:38:24: error: use of undeclared 
>identifier 'INT64_C'
>  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));
>                       ^
>/usr/local/include/llvm/Support/MathExtras.h:38:56: error: use of undeclared 
>identifier  'INT64_C'
>  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));
>                                                       ^
>/usr/local/include/llvm/Support/MathExtras.h:57:26: error: use of undeclared 
>identifier 'UINT64_C'
>  return N >= 64 || x < (UINT64_C(1)<<N);
>                         ^
>/usr/local/include/llvm/Support/MathExtras.h:82:24: error: use of undeclared 
>identifier 'INT64_C'
>  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x <  (INT64_C(1)<<(N-1)));
>                       ^
>/usr/local/include/llvm/Support/MathExtras.h:82:56: error: use of undeclared 
>identifier 'INT64_C'
>  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));
>                                                       ^
>7 errors generated.
>
>======================================
>Do you know what the problem is here?
>
>Thanks,
>Chen
>
>
>_______________________________________________
>cfe-dev mailing list
>cfe-dev at cs.uiuc.edu
>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
Use llvm-config script to set your compiler flags. Or just add 
"-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS" to it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110424/5ea06a3f/attachment.html>


More information about the cfe-dev mailing list