今天尝试在(qtcreator 4.7.0 + Qt 4.8.6)下编译,遇到找不到库文件问题,先开始想到的是环境配置问题

qt creator编译问题之 can not find -lQtGui

检查下来也没有线索, 又想是不是没有链接路径,参考网上,试了两个个命令

ld -lQtNetwork --verbose 

locate libQtNetwork

qt creator编译问题之 can not find -lQtGui

qt creator编译问题之 can not find -lQtGui

ld -lQtNetwork --verbose 

qt creator编译问题之 can not find -lQtGui

locate libQtNetwork

qt creator编译问题之 can not find -lQtGui

发现x86_64没有定位到libQtNetwork.so.4.8.6的软连接,于是

sudo ln -s /usr/lib/x86_64-linux-gnu/libQtNetwork.so.4.8.6 /usr/lib/x86_64-linux-gnu/libQtNetwork.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.6 /usr/lib/x86_64-linux-gnu/libQtGui.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libQtCore.so.4.8.6 /usr/lib/x86_64-linux-gnu/libQtCore.so

QT可以编译,话说QT安装的时候不会自建软链接么,还是重装软件时误删的。

refer:

https://stackoverflow.com/questions/16710047/usr-bin-ld-cannot-find-lnameofthelibrary
https://forum.qt.io/topic/45302/solved-cannot-find-lqtguid4-lqtnetworkd4-lqtcored4/14

相关文章:

  • 2021-12-18
  • 2022-12-23
  • 2021-11-13
  • 2022-02-05
  • 2022-12-23
  • 2021-06-19
  • 2021-06-29
  • 2021-10-11
猜你喜欢
  • 2022-12-23
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2021-10-04
  • 2022-12-23
相关资源
相似解决方案