[cfe-dev] Linker error while building clang

Mahesha S mahesha.llvm at gmail.com
Fri Jul 6 04:57:03 PDT 2012


Hi all,

I am a newbie to llvm world. Today, I tried to build Clang ( and llvm) by
exactly following the instruction as given in the link
http://clang.llvm.org/get_started.html. But, I am getting the following
linker error. It would be great if anybody help me in resolving this issue.

---------------------------------------------------------------------------------------------------------------------------------------------------------------
make[3]: Entering directory
`/home/mahesha/sources/build/tools/clang/unittests'
make[4]: Entering directory
`/home/mahesha/sources/build/tools/clang/unittests/ASTMatchers'
llvm[4]: Compiling ASTMatchersTest.cpp for Debug+Asserts build
llvm[4]: Linking Debug+Asserts unit test ASTMatchers
/home/mahesha/sources/build/Debug+Asserts/lib/libclangFrontend.a(DiagnosticRenderer.o):
In function `mergeFixits':
/home/mahesha/sources/llvm/tools/clang/lib/Frontend/DiagnosticRenderer.cpp:97:
undefined reference to
`clang::edit::Commit::insertFromRange(clang::SourceLocation,
clang::CharSourceRange, bool, bool)'
/home/mahesha/sources/llvm/tools/clang/lib/Frontend/DiagnosticRenderer.cpp:99:
undefined reference to `clang::edit::Commit::remove(clang::CharSourceRange)'
/home/mahesha/sources/llvm/tools/clang/lib/Frontend/DiagnosticRenderer.cpp:103:
undefined reference to
`clang::edit::Commit::replace(clang::CharSourceRange, llvm::StringRef)'
/home/mahesha/sources/llvm/tools/clang/lib/Frontend/DiagnosticRenderer.cpp:106:
undefined reference to `clang::edit::Commit::insert(clang::SourceLocation,
llvm::StringRef, bool, bool)'
/home/mahesha/sources/llvm/tools/clang/lib/Frontend/DiagnosticRenderer.cpp:111:
undefined reference to
`clang::edit::EditedSource::commit(clang::edit::Commit const&)'
/home/mahesha/sources/llvm/tools/clang/lib/Frontend/DiagnosticRenderer.cpp:113:
undefined reference to
`clang::edit::EditedSource::applyRewrites(clang::edit::EditsReceiver&)'
/home/mahesha/sources/build/Debug+Asserts/lib/libclangFrontend.a(DiagnosticRenderer.o):
In function `EditsReceiver':
/home/mahesha/sources/llvm/tools/clang/lib/Frontend/../../include/clang/Edit/EditsReceiver.h:21:
undefined reference to `vtable for clang::edit::EditsReceiver'
/home/mahesha/sources/build/Debug+Asserts/lib/libclangFrontend.a(DiagnosticRenderer.o):
In function `~EditsReceiver':
/home/mahesha/sources/llvm/tools/clang/lib/Frontend/../../include/clang/Edit/EditsReceiver.h:23:
undefined reference to `vtable for clang::edit::EditsReceiver'
/home/mahesha/sources/build/Debug+Asserts/lib/libclangFrontend.a(DiagnosticRenderer.o):(.
data.rel.ro+0x30): undefined reference to
`clang::edit::EditsReceiver::remove(clang::CharSourceRange)'
/home/mahesha/sources/build/Debug+Asserts/lib/libclangSema.a(SemaExprObjC.o):
In function `applyCocoaAPICheck':
/home/mahesha/sources/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp:1905:
undefined reference to
`clang::edit::Commit::Edit::getInsertFromRange(clang::SourceManager&) const'
/home/mahesha/sources/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp:1908:
undefined reference to
`clang::edit::Commit::Edit::getFileRange(clang::SourceManager&) const'
/home/mahesha/sources/build/Debug+Asserts/lib/libclangSema.a(SemaExprObjC.o):
In function `checkCocoaAPI':
/home/mahesha/sources/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp:1917:
undefined reference to
`clang::edit::rewriteObjCRedundantCallWithLiteral(clang::ObjCMessageExpr
const*, clang::NSAPI const&, clang::edit::Commit&)'
collect2: ld returned 1 exit status
make[4]: *** [Debug+Asserts/ASTMatchersTests] Error 1
make[4]: Leaving directory
`/home/mahesha/sources/build/tools/clang/unittests/ASTMatchers'
make[3]: *** [ASTMatchers/.makeall] Error 2
make[3]: Leaving directory
`/home/mahesha/sources/build/tools/clang/unittests'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/home/mahesha/sources/build/tools/clang'
make[1]: *** [clang/.makeall] Error 2
make[1]: Leaving directory `/home/mahesha/sources/build/tools'
make: *** [all] Error 1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------


Cheers
-mahesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120706/1073225b/attachment.html>


More information about the cfe-dev mailing list