<div dir="ltr">i've also checked llvm-config output and it seems to be ok (contain -L and -lLLVMSupport):<div><br></div><div>







<p class="">clang++ -L/Users/asmirnov/Documents/dev/src/llvm_34_local_installed2/lib   -lcurses -lpthread -lz ./lib_cmd_builder_x86_64.o -o exe_cmd_builder_x86_64 -lLLVMInstrumentation -lLLVMIRReader -lLLVMAsmParser -lLLVMDebugInfo -lLLVMOption -lLLVMLTO -lLLVMLinker -lLLVMipo -lLLVMVectorize -lLLVMBitWriter -lLLVMBitReader -lLLVMTableGen -lLLVMXCoreDisassembler -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMXCoreAsmPrinter -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMSystemZDisassembler -lLLVMSystemZCodeGen -lLLVMSystemZAsmParser -lLLVMSystemZDesc -lLLVMSystemZInfo -lLLVMSystemZAsmPrinter -lLLVMSparcCodeGen -lLLVMSparcDesc -lLLVMSparcInfo -lLLVMR600CodeGen -lLLVMR600Desc -lLLVMR600Info -lLLVMR600AsmPrinter -lLLVMPowerPCCodeGen -lLLVMPowerPCAsmParser -lLLVMPowerPCDesc -lLLVMPowerPCInfo -lLLVMPowerPCAsmPrinter -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMNVPTXAsmPrinter -lLLVMMSP430CodeGen -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMSP430AsmPrinter -lLLVMMipsDisassembler -lLLVMMipsCodeGen -lLLVMMipsAsmParser -lLLVMMipsDesc -lLLVMMipsInfo -lLLVMMipsAsmPrinter -lLLVMHexagonCodeGen -lLLVMHexagonAsmPrinter -lLLVMHexagonDesc -lLLVMHexagonInfo -lLLVMCppBackendCodeGen -lLLVMCppBackendInfo -lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMAArch64Disassembler -lLLVMAArch64CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMAArch64AsmParser -lLLVMAArch64Desc -lLLVMAArch64Info -lLLVMAArch64AsmPrinter -lLLVMAArch64Utils -lLLVMMCDisassembler -lLLVMMCParser -lLLVMInterpreter -lLLVMMCJIT -lLLVMJIT -lLLVMCodeGen -lLLVMObjCARCOpts -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport -lclangARCMigrate -lclangAST -lclangASTMatchers -lclangAnalysis -lclangApplyReplacements -lclangBasic -lclangCodeGen -lclangDriver -lclangDynamicASTMatchers -lclangEdit -lclangFormat -lclangFrontend -lclangFrontendTool -lclangIndex -lclangLex -lclangParse -lclangQuery -lclangRewriteCore -lclangRewriteFrontend -lclangSema -lclangSerialization -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore -lclangStaticAnalyzerFrontend -lclangTidy -lclangTidyGoogleModule -lclangTidyLLVMModule</p></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-09-14 14:26 GMT+06:00 Anton Smirnov <span dir="ltr"><<a href="mailto:dev@antonsmirnov.name" target="_blank">dev@antonsmirnov.name</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi.<div><br></div><div>I'm trying to compile reduced clang "driver.cpp" - added printf for arguments - and i'm getting linking with libLLVMSupport.a error - no StringSaver class found.</div><div><br></div><div><div># lib</div><div>echo "compiling cmd builder (x86_64) ..."</div><div>clang++ `../llvm_34_local_installed2/bin/llvm-config --cxxflags` -I ../llvm_34/tools/clang/include -I ../llvm_34_build_local2/tools/clang/include  -c ./lib_cmd_builder.cpp -o ./lib_cmd_builder_x86_64.o</div><div><br></div><div>echo "linking cmd builder (x86_64) ..."</div><div>CMD="clang++ `../llvm_34_local_installed2/bin/llvm-config --ldflags` ./lib_cmd_builder_x86_64.o -o exe_cmd_builder_x86_64 `../llvm_34_local_installed2/bin/llvm-config --libs` -lclangARCMigrate -lclangAST -lclangASTMatchers -lclangAnalysis -lclangApplyReplacements -lclangBasic -lclangCodeGen -lclangDriver -lclangDynamicASTMatchers -lclangEdit -lclangFormat -lclangFrontend -lclangFrontendTool -lclangIndex -lclangLex -lclangParse -lclangQuery -lclangRewriteCore -lclangRewriteFrontend -lclangSema -lclangSerialization -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore -lclangStaticAnalyzerFrontend -lclangTidy -lclangTidyGoogleModule -lclangTidyLLVMModule"</div></div><div><br></div><div>Error message:</div><div>







<p>Undefined symbols for architecture x86_64:</p>
<p>  "typeinfo for llvm::cl::StringSaver", referenced from:</p>
<p>      typeinfo for (anonymous namespace)::StringSetSaver in lib_cmd_builder_x86_64.o</p>
<p>ld: symbol(s) not found for architecture x86_64</p>
<p>clang: error: linker command failed with exit code 1 (use -v to see invocation)</p><p><br></p><p>Checking libLLVM is found and contains CommandLine object data:</p><p>(found on -L path):</p><p>find ../llvm_34_local_installed2/lib/ -name "*upport*"</p><p>








</p><p>../llvm_34_local_installed2/lib//libLLVMSupport.a</p><p><br></p><p>(contains CommandLine.cpp object data):</p><p>ar -t ../llvm_34_local_installed2/lib//libLLVMSupport.a | grep CommandLine</p><p>








</p><p>CommandLine.cpp.o</p><p><br></p><p>The class StringSaver is declared  in CommandLine.cpp:</p><p><br></p><p>/Users/asmirnov/Documents/dev/src/llvm_34/include/llvm/Support/CommandLine.h<br></p><p>class StringSaver {</p><p>  virtual void anchor();</p><p>public:</p><p>  virtual const char *SaveString(const char *Str) = 0;</p><p>  virtual ~StringSaver() {};  // Pacify -Wnon-virtual-dtor.</p><p>};</p><p><br></p><p>StringSaver inheritor is declared and implemented in self file (lib_cmd_builder.cpp):</p><p>namespace {</p><p>  class StringSetSaver : public llvm::cl::StringSaver {</p><p>  public:</p><p>    StringSetSaver(std::set<std::string> &Storage) : Storage(Storage) {}</p><p>    const char *SaveString(const char *Str) LLVM_OVERRIDE {</p><p>      return SaveStringInSet(Storage, Str);</p><p>    }</p><p>  private:</p><p>    std::set<std::string> &Storage;</p><p>  };</p><p>}</p><p><br></p><p>So i can't understand why i'm having this error.</p><p>Any thoughts?</p></div></div>
</blockquote></div><br></div>