背景:使用OpenGL的GLFW3.1库的时候,使用其中一些代码

报error adding symbols: DSO missing from command line

因为使用的是Qcreator,解决方法是在.pro文件里加一些库

LIBS +=-lpthread
LIBS +=-lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor

找具体缺少的库使用

pkg-config

Linux 命令行运行

pkg-config --print-requires --print-requires-private glfw3

得到缺失的包列表如下

x11
xrandr
xi
xxf86vm
gl

找需要包含的lib,使用

pkg-config --libs

命令,加上缺失的包,如:

pkg-config --libs x11

得到-lX11 ,即开头包含的库之一。对缺失的包依次运行得到要补充的包。

相关文章:

  • 2022-12-23
  • 2021-12-05
  • 2021-11-16
  • 2022-12-23
  • 2021-06-25
  • 2021-06-21
  • 2021-07-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2022-12-23
相关资源
相似解决方案