undefined reference to symbol 'XF86VidModeQueryExtension' (linux, qt creator IDE)

后端 未结 1 599
离开以前
离开以前 2021-01-21 04:16

I\'ve been trying to get some simple GL code that implements GFLW3 to compile on QT Creator (on Ubuntu 13.04). However I keep getting the same output when it tries building:

1条回答
  •  一个人的身影
    2021-01-21 04:49

    The problem is here:

    LIBS += -lXxf86vm -L/usr/lib/x86_64-linux-gnu/libXxf86vm.so.1
    LIBS += -lXxf86vm -L/user/lib/x86_64-linux-gnu/libXxf86vm.so
    LIBS += -lXxf86vm -L/user/lib/x86_64-linux-gnu/libXxf86vm.a
    LIBS += -lXxf86vm -L/user/lib/x86_64-linux-gnu/libXxf86vm.so.1.0.0
    

    You are using the -L option with a file name rather than a path! You should change those four lines to:

    LIBS += -lXxf86vm -L/user/lib/x86_64-linux-gnu/
    

    Secondly, if the ordering matters, you would need to use LIBS for glfw3, too, something like this:

    LIBS += -lglfw3 -lXxf86vm -L/user/lib/x86_64-linux-gnu/
    

    Do not forget to assign the glfw3 path as well if needed. That is depending on your setup. You could probably try to swap the order of your current PKGCONFIG and LIBS statements, but it is not that much future proof if you move code around. Also, if you can share the path between the two libraries, I would not personally use PKGCONFIG, just LIBS.

    0 讨论(0)
提交回复
热议问题