GLEW Linker Errors (undefined reference to `__glewBindVertexArray')

前端 未结 3 664
栀梦
栀梦 2020-12-03 23:56

I\'ve recently made the decision to re-write some OpenGL code for a game using im working on using non depreciated techniques. Instead of drawing primitives with glBegin() a

3条回答
  •  情话喂你
    2020-12-04 00:39

    Try this:

    pkg-config --libs --static glew
    

    in the terminal. Then, copy the libs it gives you and paste after your gcc/g++ statement:

    g++ .cpp -o  -lGL -lGLU -lglfw3 -lrt -lm -ldl -lXrandr -lXinerama -lXcursor -lXext -lXrender -lXfixes -lX11 -lpthread -lxcb -lXau -lXdmcp -lGLEW -lGLU -lGL -lm -ldl -ldrm -lXdamage -lX11-xcb -lxcb-glx -lxcb-dri2 -lxcb-dri3 -lxcb-present -lxcb-sync -lxshmfence -lXxf86vm -lXfixes -lXext -lX11 -lpthread -lxcb -lXau -lXdmcp 
    

    (some are repeated above because I used glfw too)

    This is supposed to solve your problem, because usually these libraries are not declared.

提交回复
热议问题