[cfe-dev] Linking clang on linux

Reid Kleckner rnk at google.com
Thu Jun 12 09:50:08 PDT 2014


It sounds like the order of libraries passed to the linker is incorrect.
 The inputs have to be sorted topologically, where each library appears
before all of its dependencies.

Alternatively you can use --start-group ... --end-group to make it search
out of order, but that shouldn't be necessary.


On Thu, Jun 12, 2014 at 6:58 AM, Kim <soldoutseashell at gmail.com> wrote:

> I'm trying to get my project (which uses clang) to build on linux and I'm
> running into a unresolved symbol error while loading one of the modules:
>
> undefined symbol: _ZN5clang11ASTConsumer21HandleInterestingDeclENS_
> 12DeclGroupRefE
>
> Searching for the symbol in the clang/LLVM libraries indicates the symbol
> resides in libclangAST.a:
>
> ./libclangAST.a
> 0000000000000000 T _ZN5clang11ASTConsumer21HandleInterestingDeclENS_
> 12DeclGroupRefE
>
> I'm already linking libclangAST.a into my project so I'm wondering what
> I'm missing or what the problem could be otherwise:
>
> LLVMLIBS = libLLVMProfileData.a libLLVMCppBackendCodeGen.a
> libLLVMX86CodeGen.a libLLVMX86AsmParser.a libLLVMX86Disassembler.a
> libLLVMBitWriter.a libLLVMIRReader.a libLLVMInstrumentation.a libLLVMipo.a
> libLLVMLinker.a libLLVMCppBackendInfo.a libLLVMX86Desc.a libLLVMXCoreDesc.a
> libLLVMAsmParser.a libLLVMBitReader.a libLLVMVectorize.a
> libLLVMAsmPrinter.a libLLVMSelectionDAG.a libLLVMMipsAsmPrinter.a
> libLLVMMipsInfo.a libLLVMX86AsmPrinter.a libLLVMX86Info.a libLLVMMCParser.a
> libLLVMCodeGen.a libLLVMX86Utils.a libLLVMObjCARCOpts.a libLLVMScalarOpts.a
> libLLVMInstCombine.a libLLVMTransformUtils.a libLLVMipa.a libLLVMAnalysis.a
> libLLVMTarget.a libLLVMCore.a libLLVMMC.a libLLVMObject.a libLLVMSupport.a
> libclangFrontendTool.a libclangAST.a libclangAnalysis.a libclangBasic.a
> libclangCodeGen.a libclangDriver.a libclangEdit.a libclangFrontend.a
> libclangLex.a libclangParse.a libclangSema.a libclangSerialization.a
> libclangStaticAnalyzerFrontend.a libclangStaticAnalyzerCheckers.a
> libclangStaticAnalyzerCore.a libclangARCMigrate.a libclangRewriteCore.a
> libclangRewriteFrontend.a libLLVMOption.a
>
> Thanks a lot
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140612/2daafa37/attachment.html>


More information about the cfe-dev mailing list