项目中遇到一个问题,库是已经编译好的库,用-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