<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Since the log tells you that llvm::outs() is not found, and since it is supposed to be found in libLLVMSupport.a, you can try:<div class=""><br class=""></div><div class="">$ nm /home/a/build//lib/libLLVMSupport.a  | grep ZN4llvm4outsEv</div><div class="">...</div><div class="">0000000000002070 T __ZN4llvm4outsEv<br class="">...</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">The output should have the symbol defined.</div><div class=""><br class=""></div><div class="">-- </div><div class="">Mehdi</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 25, 2016, at 12:18 AM, Russell Wallace via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Tried that just now, same result.</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Mar 25, 2016 at 6:58 AM, Snehasish Kumar <span dir="ltr" class=""><<a href="mailto:kumar.snehasish@gmail.com" target="_blank" class="">kumar.snehasish@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Russel,<br class="">
<br class="">
Can you try compiling aklo.o using -fno-rtti prior to linking?<br class="">
<div class=""><div class="h5"><br class="">
On Thu, Mar 24, 2016 at 11:44 PM, Russell Wallace via llvm-dev<br class="">
<<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class="">
> I'm trying to link a program with LLVM on Linux. I've managed to take out<br class="">
> the test files from 'llvm-config --libs' but now it's getting errors with<br class="">
> missing symbols. The same program successfully links with the same version<br class="">
> of LLVM (3.8) on Windows, so it's not a problem with the code per se, it's<br class="">
> some kind of configuration issue. Any ideas?<br class="">
><br class="">
> g++ -std=c++11 -I/home/a/llvm/include -I/home/a/build/include<br class="">
> -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS<br class="">
> -D__STDC_LIMIT_MACROS -g -O2 -L/home/a/build//lib<br class="">
> -lLLVMLTO -lLLVMObjCARCOpts -lLLVMSymbolize -lLLVMDebugInfoPDB<br class="">
> -lLLVMDebugInfoDWARF -lLLVMXCoreDisassembler -lLLVMXCoreCodeGen<br class="">
> -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMXCoreAsmPrinter<br class="">
> -lLLVMSystemZDisassembler -lLLVMSystemZCodeGen -lLLVMSystemZAsmParser<br class="">
> -lLLVMSystemZDesc -lLLVMSystemZInfo -lLLVMSystemZAsmPrinter<br class="">
> -lLLVMSparcDisassembler -lLLVMSparcCodeGen -lLLVMSparcAsmParser<br class="">
> -lLLVMSparcDesc -lLLVMSparcInfo -lLLVMSparcAsmPrinter<br class="">
> -lLLVMPowerPCDisassembler -lLLVMPowerPCCodeGen -lLLVMPowerPCAsmParser<br class="">
> -lLLVMPowerPCDesc -lLLVMPowerPCInfo -lLLVMPowerPCAsmPrinter<br class="">
> -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMNVPTXAsmPrinter<br class="">
> -lLLVMMSP430CodeGen -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMSP430AsmPrinter<br class="">
> -lLLVMMipsDisassembler -lLLVMMipsCodeGen -lLLVMMipsAsmParser -lLLVMMipsDesc<br class="">
> -lLLVMMipsInfo -lLLVMMipsAsmPrinter -lLLVMHexagonDisassembler<br class="">
> -lLLVMHexagonCodeGen -lLLVMHexagonAsmParser -lLLVMHexagonDesc<br class="">
> -lLLVMHexagonInfo -lLLVMCppBackendCodeGen -lLLVMCppBackendInfo<br class="">
> -lLLVMBPFCodeGen -lLLVMBPFDesc -lLLVMBPFInfo -lLLVMBPFAsmPrinter<br class="">
> -lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMAsmParser -lLLVMARMDesc<br class="">
> -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMAMDGPUCodeGen -lLLVMAMDGPUAsmParser<br class="">
> -lLLVMAMDGPUDesc -lLLVMAMDGPUUtils -lLLVMAMDGPUInfo -lLLVMAMDGPUAsmPrinter<br class="">
> -lLLVMAArch64Disassembler -lLLVMAArch64CodeGen -lLLVMAArch64AsmParser<br class="">
> -lLLVMAArch64Desc -lLLVMAArch64Info -lLLVMAArch64AsmPrinter<br class="">
> -lLLVMAArch64Utils -lLLVMMIRParser -lLLVMLibDriver -lLLVMOption<br class="">
> -lLLVMTableGen -lLLVMLineEditor -lLLVMX86Disassembler -lLLVMX86AsmParser<br class="">
> -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMX86Desc<br class="">
> -lLLVMMCDisassembler -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils<br class="">
> -lLLVMMCJIT -lLLVMPasses -lLLVMipo -lLLVMVectorize -lLLVMLinker<br class="">
> -lLLVMIRReader -lLLVMAsmParser -lLLVMDebugInfoCodeView -lLLVMInterpreter<br class="">
> -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMInstrumentation<br class="">
> -lLLVMProfileData -lLLVMBitWriter -lLLVMOrcJIT -lLLVMTransformUtils<br class="">
> -lLLVMExecutionEngine -lLLVMTarget -lLLVMAnalysis -lLLVMRuntimeDyld<br class="">
> -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMMC -lLLVMCore<br class="">
> -lLLVMSupport                        -ldl -lpthread -ltinfo  -o aklo<br class="">
> aklo-aklo.o<br class="">
> aklo-aklo.o: In function `operator()':<br class="">
> /mnt/a2/aklo.cpp:442: undefined reference to `llvm::outs()'<br class="">
> aklo-aklo.o: In function `llvm::raw_ostream::operator<<(llvm::StringRef)':<br class="">
> /home/a/llvm/include/llvm/Support/raw_ostream.h:166: undefined reference to<br class="">
> `llvm::raw_ostream::write(char const*, unsigned long)'<br class="">
> aklo-aklo.o: In function `operator()':<br class="">
> /mnt/a2/aklo.cpp:443: undefined reference to `llvm::outs()'<br class="">
> /mnt/a2/aklo.cpp:447: undefined reference to `llvm::outs()'<br class="">
> /mnt/a2/aklo.cpp:450: undefined reference to `llvm::outs()'<br class="">
> /mnt/a2/aklo.cpp:452: undefined reference to `llvm::outs()'<br class="">
> aklo-aklo.o: In function `llvm::raw_ostream::operator<<(char const*)':<br class="">
> /home/a/llvm/include/llvm/Support/raw_ostream.h:166: undefined reference to<br class="">
> `llvm::raw_ostream::write(char const*, unsigned long)'<br class="">
> aklo-aklo.o: In function `llvm::raw_ostream::operator<<(llvm::StringRef)':<br class="">
> /home/a/llvm/include/llvm/Support/raw_ostream.h:166: undefined reference to<br class="">
> `llvm::raw_ostream::write(char const*, unsigned long)'<br class="">
> /home/a/llvm/include/llvm/Support/raw_ostream.h:166: undefined reference to<br class="">
> `llvm::raw_ostream::write(char const*, unsigned long)'<br class="">
> aklo-aklo.o: In function `operator()':<br class="">
> /mnt/a2/aklo.cpp:430: undefined reference to `llvm::errs()'<br class="">
> aklo-aklo.o: In function `llvm::raw_ostream::operator<<(char)':<br class="">
> /home/a/llvm/include/llvm/Support/raw_ostream.h:141: undefined reference to<br class="">
> `llvm::raw_ostream::write(unsigned char)'<br class="">
> aklo-aklo.o: In function `error(std::string)':<br class="">
> /mnt/a2/aklo.cpp:172: undefined reference to<br class="">
> `llvm::SourceMgr::PrintMessage(llvm::SMLoc, llvm::SourceMgr::DiagKind,<br class="">
> llvm::Twine const&, llvm::ArrayRef<llvm::SMRange>,<br class="">
> llvm::ArrayRef<llvm::SMFixIt>, bool) const'<br class="">
> aklo-aklo.o: In function `print(long)':<br class="">
> /mnt/a2/aklo.cpp:388: undefined reference to `llvm::outs()'<br class="">
> /mnt/a2/aklo.cpp:393: undefined reference to `llvm::outs()'<br class="">
> aklo-aklo.o: In function `llvm::raw_ostream::operator<<(char)':<br class="">
> /home/a/llvm/include/llvm/Support/raw_ostream.h:141: undefined reference to<br class="">
> `llvm::raw_ostream::write(unsigned char)'<br class="">
> aklo-aklo.o: In function `print(long)':<br class="">
> /mnt/a2/aklo.cpp:395: undefined reference to `llvm::outs()'<br class="">
> /mnt/a2/aklo.cpp:401: undefined reference to `llvm::outs()'<br class="">
> /mnt/a2/aklo.cpp:398: undefined reference to `llvm::outs()'<br class="">
> aklo-aklo.o: In function `llvm::raw_ostream::operator<<(char)':<br class="">
> /home/a/llvm/include/llvm/Support/raw_ostream.h:141: undefined reference to<br class="">
> `llvm::raw_ostream::write(unsigned char)'<br class="">
> aklo-aklo.o: In function `llvm::StringMap<long,<br class="">
> llvm::MallocAllocator>::find(llvm::StringRef) const':<br class="">
> /home/a/llvm/include/llvm/ADT/StringMap.h:284: undefined reference to<br class="">
> `llvm::StringMapImpl::FindKey(llvm::StringRef) const'<br class="">
> aklo-aklo.o: In function `llvm::StringMap<long,<br class="">
> llvm::MallocAllocator>::insert(std::pair<llvm::StringRef, long>)':<br class="">
> /home/a/llvm/include/llvm/ADT/StringMap.h:331: undefined reference to<br class="">
> `llvm::StringMapImpl::LookupBucketFor(llvm::StringRef)'<br class="">
> /home/a/llvm/include/llvm/ADT/StringMap.h:344: undefined reference to<br class="">
> `llvm::StringMapImpl::RehashTable(unsigned int)'<br class="">
> aklo-aklo.o: In function `llvm::raw_ostream::operator<<(char const*)':<br class="">
> /home/a/llvm/include/llvm/Support/raw_ostream.h:166: undefined reference to<br class="">
> `llvm::raw_ostream::write(char const*, unsigned long)'<br class="">
> aklo-aklo.o: In function `llvm::raw_ostream::operator<<(std::string<br class="">
> const&)':<br class="">
> /home/a/llvm/include/llvm/Support/raw_ostream.h:184: undefined reference to<br class="">
> `llvm::raw_ostream::write(char const*, unsigned long)'<br class="">
> aklo-aklo.o: In function `print(long)':<br class="">
> /mnt/a2/aklo.cpp:398: undefined reference to<br class="">
> `llvm::raw_ostream::operator<<(long)'<br class="">
> aklo-aklo.o: In function `llvm::raw_ostream::operator<<(char)':<br class="">
> /home/a/llvm/include/llvm/Support/raw_ostream.h:141: undefined reference to<br class="">
> `llvm::raw_ostream::write(unsigned char)'<br class="">
> aklo-aklo.o: In function `llvm::cl::list<std::string, bool,<br class="">
> llvm::cl::parser<std::string> >::getOptionWidth() const':<br class="">
> /home/a/llvm/include/llvm/Support/CommandLine.h:1387: undefined reference to<br class="">
> `llvm::cl::basic_parser_impl::getOptionWidth(llvm::cl::Option const&) const'<br class="">
> aklo-aklo.o: In function `llvm::cl::list<std::string, bool,<br class="">
> llvm::cl::parser<std::string> >::printOptionInfo(unsigned long) const':<br class="">
> /home/a/llvm/include/llvm/Support/CommandLine.h:1390: undefined reference to<br class="">
> `llvm::cl::basic_parser_impl::printOptionInfo(llvm::cl::Option const&,<br class="">
> unsigned long) const'<br class="">
> aklo-aklo.o: In function `~basic_parser':<br class="">
> /home/a/llvm/include/llvm/Support/CommandLine.h:763: undefined reference to<br class="">
> `vtable for llvm::cl::basic_parser<std::string>'<br class="">
> aklo-aklo.o: In function `~Option':<br class="">
> /home/a/llvm/include/llvm/Support/CommandLine.h:290: undefined reference to<br class="">
> `vtable for llvm::cl::Option'<br class="">
> aklo-aklo.o: In function `~basic_parser':<br class="">
> /home/a/llvm/include/llvm/Support/CommandLine.h:763: undefined reference to<br class="">
> `vtable for llvm::cl::basic_parser<std::string>'<br class="">
> aklo-aklo.o: In function `~Option':<br class="">
> /home/a/llvm/include/llvm/Support/CommandLine.h:290: undefined reference to<br class="">
> `vtable for llvm::cl::Option'<br class="">
> aklo-aklo.o: In function `llvm::raw_ostream::operator<<(llvm::StringRef)':<br class="">
> /home/a/llvm/include/llvm/Support/raw_ostream.h:166: undefined reference to<br class="">
> `llvm::raw_ostream::write(char const*, unsigned long)'<br class="">
> aklo-aklo.o: In function `main':<br class="">
> /mnt/a2/aklo.cpp:434: undefined reference to<br class="">
> `llvm::sys::PrintStackTraceOnErrorSignal(bool)'<br class="">
> aklo-aklo.o: In function `PrettyStackTraceProgram':<br class="">
> /home/a/llvm/include/llvm/Support/PrettyStackTrace.h:63: undefined reference<br class="">
> to `llvm::PrettyStackTraceEntry::PrettyStackTraceEntry()'<br class="">
> /home/a/llvm/include/llvm/Support/PrettyStackTrace.h:63: undefined reference<br class="">
> to `vtable for llvm::PrettyStackTraceProgram'<br class="">
> /home/a/llvm/include/llvm/Support/PrettyStackTrace.h:64: undefined reference<br class="">
> to `llvm::EnablePrettyStackTrace()'<br class="">
> aklo-aklo.o: In function `main':<br class="">
> /mnt/a2/aklo.cpp:456: undefined reference to<br class="">
> `llvm::cl::AddExtraVersionPrinter(void (*)())'<br class="">
> /mnt/a2/aklo.cpp:457: undefined reference to<br class="">
> `llvm::cl::ParseCommandLineOptions(int, char const* const*, char const*)'<br class="">
> /mnt/a2/aklo.cpp:460: undefined reference to<br class="">
> `llvm::MemoryBuffer::getFileOrSTDIN(llvm::Twine const&, long, bool)'<br class="">
> /mnt/a2/aklo.cpp:469: undefined reference to `llvm::outs()'<br class="">
> aklo-aklo.o: In function `~PrettyStackTraceProgram':<br class="">
> /home/a/llvm/include/llvm/Support/PrettyStackTrace.h:58: undefined reference<br class="">
> to `vtable for llvm::PrettyStackTraceProgram'<br class="">
> /home/a/llvm/include/llvm/Support/PrettyStackTrace.h:58: undefined reference<br class="">
> to `llvm::PrettyStackTraceEntry::~PrettyStackTraceEntry()'<br class="">
> aklo-aklo.o: In function `llvm::raw_ostream::operator<<(char)':<br class="">
> /home/a/llvm/include/llvm/Support/raw_ostream.h:141: undefined reference to<br class="">
> `llvm::raw_ostream::write(unsigned char)'<br class="">
> aklo-aklo.o: In function `main':<br class="">
> /mnt/a2/aklo.cpp:463: undefined reference to `llvm::errs()'<br class="">
> /mnt/a2/aklo.cpp:463: undefined reference to `llvm::SMDiagnostic::print(char<br class="">
> const*, llvm::raw_ostream&, bool, bool) const'<br class="">
> aklo-aklo.o: In function `PrettyStackTraceProgram':<br class="">
> /home/a/llvm/include/llvm/Support/PrettyStackTrace.h:63: undefined reference<br class="">
> to `llvm::PrettyStackTraceEntry::~PrettyStackTraceEntry()'<br class="">
> aklo-aklo.o: In function `~PrettyStackTraceProgram':<br class="">
> /home/a/llvm/include/llvm/Support/PrettyStackTrace.h:58: undefined reference<br class="">
> to `vtable for llvm::PrettyStackTraceProgram'<br class="">
> /home/a/llvm/include/llvm/Support/PrettyStackTrace.h:58: undefined reference<br class="">
> to `llvm::PrettyStackTraceEntry::~PrettyStackTraceEntry()'<br class="">
> aklo-aklo.o: In function `__static_initialization_and_destruction_0':<br class="">
> /mnt/a2/aklo.cpp:164: undefined reference to `llvm::SourceMgr::~SourceMgr()'<br class="">
> aklo-aklo.o: In function `Option':<br class="">
> /home/a/llvm/include/llvm/Support/CommandLine.h:253: undefined reference to<br class="">
> `vtable for llvm::cl::Option'<br class="">
> /home/a/llvm/include/llvm/Support/CommandLine.h:253: undefined reference to<br class="">
> `llvm::cl::GeneralCategory'<br class="">
> aklo-aklo.o: In function `parser':<br class="">
> /home/a/llvm/include/llvm/Support/CommandLine.h:938: undefined reference to<br class="">
> `vtable for llvm::cl::parser<std::string>'<br class="">
> aklo-aklo.o: In function `llvm::cl::list<std::string, bool,<br class="">
> llvm::cl::parser<std::string> >::done()':<br class="">
> /home/a/llvm/include/llvm/Support/CommandLine.h:1398: undefined reference to<br class="">
> `llvm::cl::Option::addArgument()'<br class="">
> aklo-aklo.o: In function `~basic_parser':<br class="">
> /home/a/llvm/include/llvm/Support/CommandLine.h:763: undefined reference to<br class="">
> `vtable for llvm::cl::basic_parser<std::string>'<br class="">
> aklo-aklo.o: In function `~Option':<br class="">
> /home/a/llvm/include/llvm/Support/CommandLine.h:290: undefined reference to<br class="">
> `vtable for llvm::cl::Option'<br class="">
> aklo-aklo.o:(.rodata._ZTIN4llvm2cl4listISsbNS0_6parserISsEEEE[_ZTIN4llvm2cl4listISsbNS0_6parserISsEEEE]+0x18):<br class="">
> undefined reference to `typeinfo for llvm::cl::Option'<br class="">
> aklo-aklo.o:(.rodata._ZTVN4llvm2cl4listISsbNS0_6parserISsEEEE[_ZTVN4llvm2cl4listISsbNS0_6parserISsEEEE]+0x20):<br class="">
> undefined reference to `llvm::cl::Option::anchor()'<br class="">
> aklo-aklo.o:(.rodata._ZTVN4llvm2cl4listISsbNS0_6parserISsEEEE[_ZTVN4llvm2cl4listISsbNS0_6parserISsEEEE]+0x48):<br class="">
> undefined reference to `llvm::cl::Option::addOccurrence(unsigned int,<br class="">
> llvm::StringRef, llvm::StringRef, bool)'<br class="">
> collect2: error: ld returned 1 exit status<br class="">
><br class="">
><br class="">
</div></div>> _______________________________________________<br class="">
> LLVM Developers mailing list<br class="">
> <a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
><br class="">
<span class="HOEnZb"><font color="#888888" class=""><br class="">
<br class="">
<br class="">
--<br class="">
Snehasish Kumar<br class="">
School of Computing Science<br class="">
Simon Fraser University<br class="">
</font></span></blockquote></div><br class=""></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>