GLFW3出error adding symbols: DSO missing from command line解决

背景:使用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 ,即开头包含的库之一。对缺失的包依次运行得到要补充的包。

posted on 2015-02-13 16:43  褐鹤  阅读(7880)  评论(0编辑  收藏  举报

导航