庫檔案存,ld報錯找不到
阿新 • • 發佈:2019-02-07
專案中遇到一個問題,庫是已經編譯好的庫,用-L選項,編譯缺提示找不到庫檔案,如下:
not found (try using -rpath or -rpath-link)
在網路上找到答案,感謝萬能的google:
When you see the following kind of errors during cross compilation (linking phase):
ld: warning: libfontconfig.so.1, needed by …/libQtGui.so, not found (try using -rpath or -rpath-link)
ld: warning: libaudio.so.2, needed by …/libQtGui.so, not found (try using -rpath or -rpath-link)
There could be two reasons:
- the list of required binaries is not complete and linker cannot complete the linking automatically
- your $SYSROOT/usr/lib is not passed to linker by -rpath-link as mentioned in error message