您的位置:首页 > 运维架构 > Linux

./pdffigures/pdffigures: /usr/lib/x86_64-linux-gnu/libstdc++.so.6:version `GLIBCXX_3.4.20' not found

2015-07-02 16:58 525 查看
./pdffigures/pdffigures:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:version`GLIBCXX_3.4.20'notfound
https://developer.ibm.com/answers/questions/184266/libstdcso6-version-glibcxx-3420-not-found.html
Hi<Soundslikelinkerissue,Pleasesuggestionsmadein

https://gcc.gnu.org/onlinedocs/libstdc++/faq.html

3.4.

HowdoIinsurethatthedynamicallylinkedlibrarywillbefound?

Dependingonyourplatformandlibraryversion,theerrormessagemightbesimilartooneofthefollowing:
./a.out:errorwhileloadingsharedlibraries:libstdc++.so.6:cannotopensharedobjectfile:Nosuchfileordirectory


/usr/libexec/ld-elf.so.1:Sharedobject"libstdc++.so.6"notfound



[/code]

Thisdoesn'tmeanthatthesharedlibraryisn'tinstalled,onlythatthedynamiclinkercan'tfindit.Whenadynamically-linkedexecutableisrunthelinkerfindsandloadstherequiredsharedlibrariesbysearchingapre-configuredlistofdirectories.If
thedirectorywhereyou'veinstalledlibstdc++isnotinthislistthenthelibrarieswon'tbefound.

Ifyoualreadyhaveanolderversionoflibstdc++installedthentheerrormightlooklikeoneofthefollowinginstead:
./a.out:/usr/lib/libstdc++.so.6:version`GLIBCXX_3.4.20'notfound

./a.out:/usr/lib/libstdc++.so.6:version`CXXABI_1.3.8'notfound



[/code]

Thismeansthelinkerfound/usr/lib/libstdc++.so.6butthatlibrarybelongstoanolderversionofGCCthanwasusedtocompileandlinktheprograma.out(orsomepartofit).Theprogramdependsoncodedefinedinthenewerlibstdc++thatbelongstothe
newerversionofGCC,sothelinkermustbetoldhowtofindthenewerlibstdc++sharedlibrary.

ThesimplestwaytofixthisistousetheLD_LIBRARY_PATHenvironmentvariable,whichisacolon-separatedlistofdirectoriesinwhichthelinkerwillsearchforsharedlibraries:
exportLD_LIBRARY_PATH=${prefix}/lib:$LD_LIBRARY_PATH



[/code]

Heretheshellvariable${prefix}isassumedtocontainthedirectoryprefixwhereGCCwasinstalledto.Thedirectorycontainingthelibrarymightdependonwhetheryouwantthe32-bitor64-bitcopyofthelibrary,soforexamplewouldbe${prefix}/lib64
onsomesystems.Theexactenvironmentvariabletousewilldependonyourplatform,e.g.DYLD_LIBRARY_PATHforDarwin,LD_LIBRARY_PATH_32/LD_LIBRARY_PATH_64forSolaris32-/64-bit,andSHLIB_PATHforHP-UX.

Seethemanpagesforld,lddandldconfigformoreinformation.Thedynamiclinkerhasdifferentnamesondifferentplatformsbutthemanpageisusuallycalledsomethingsuchasld.so,rtldordld.so.

UsingLD_LIBRARY_PATHisnotalwaysthebestsolution,FindingDynamicorSharedLibrariesinthemanualgivessomealternatives.
prefix,Iuseinubuntu64,/usr/local/lib64/,success
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: