GLFW Undefined References

前端 未结 4 1029
刺人心
刺人心 2021-01-13 22:44

I\'m trying to use GLFW on a project, but when I compile it, I get a lot of undefined reference errors, while many of them is on the library file (libglfw.a). I tried both,

相关标签:
4条回答
  • 2021-01-13 22:54

    In my case the problem was different. I was linking opengl32 in, but still getting the error. The problem turned out to be the library order: glfw has to be linked in before opengl32.

    In my case this was in the "Link libraries" listbox in the Code::Blocks IDE, but it's going to be similar in NetBeans or on the command line.

    0 讨论(0)
  • 2021-01-13 22:56

    In the linker, at Windows, MinGW: -lglew32 -lglfw3 -lopengl32 -lglu32 -lgdi32

    Put the libs and the includes files in MinGW and the dlls and exes at Windows systems folders.

    0 讨论(0)
  • 2021-01-13 23:03

    The error I got is

    undefined reference to `__imp_glfwInit'
    

    fixed the problem after I change to glfw-3.3.2.bin.WIN64 (64 bit glfw)

    0 讨论(0)
  • 2021-01-13 23:09

    Don't you have to link the OpenGL libs as well? I don't see libGL or libGLU. I know glClear is in either libGL or libGLU.

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