[cfe-dev] linker error against libclangParse

christopher taylor christopher.paul.taylor at gmail.com
Fri Jan 14 06:54:16 PST 2011


I'm attempting to write an open source tool using the clang parser.

 Unfortunately, I'm getting a boat load of linker errors. (Note, I'm
 compiling with gcc...)

 /opt/lib/libclangParse.a(ParseAST.o): In function
 `clang::ParseAST(clang::Sema&, bool)':
 ParseAST.cpp:(.text+0x4f): undefined reference to `clang::Sema::Initialize()'
 ParseAST.cpp:(.text+0x156): undefined reference to
 `clang::ASTContext::PrintStats() const'
 ParseAST.cpp:(.text+0x15b): undefined reference to
`clang::Decl::PrintStats()'
 ParseAST.cpp:(.text+0x160): undefined reference to
`clang::Stmt::PrintStats()'
 ParseAST.cpp:(.text+0x189): undefined reference to
 `clang::RecordType::classof(clang::TagType const*)'
 ParseAST.cpp:(.text+0x1a3): undefined reference to
 `clang::TagType::getDecl() const'
 ParseAST.cpp:(.text+0x1df): undefined reference to
 `clang::DeclContext::isDependentContext() const'
 ParseAST.cpp:(.text+0x216): undefined reference to
 `clang::NamedDecl::getQualifiedNameAsString() const'
 ParseAST.cpp:(.text+0x25b): undefined reference to
 `clang::ASTContext::DumpRecordLayout(clang::RecordDecl const*,
 llvm::raw_ostream&)'
 ParseAST.cpp:(.text+0x29b): undefined reference to
 `clang::Decl::CollectingStats(bool)'
 ParseAST.cpp:(.text+0x2a5): undefined reference to
 `clang::Stmt::CollectingStats(bool)'

 Here is the linking portion of my compile command:

 -fno-rtti -Wall -I/opt/include -lclangFrontend -lclangDriver
 -lclangCodeGen -lclangSema -lclangChecker -lclangAnalysis
 -lclangRewrite -lclangAST -lclangParse -lclangLex -lclangBasic
 -lLLVMSupport -lLLVMSystem `llvm-config --cxxflags --ldflags --libs
 all`

 Any assistance would be greatly appreciated, thanks!


-- 
ct



More information about the cfe-dev mailing list