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,
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.
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.
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)
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
.