Hello all,
I’m new to both OpenGL and CMake, and am trying to get GLFW working with MinGW-w64, intending to link the library dynamically. I downloaded 64-bit GLFW and simply copy-pasted the GLFW folder in the include folder to MinGW’s include directory (mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\x86_64-w64-mingw32\include
) as well as the contents of the lib-mingw-w64 folder to MinGW’s lib directory (mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\x86_64-w64-mingw32\bin
).
And of course, upon running the example code, I get linker errors I’m too new to understand:
undefined reference to
glfwInit' undefined reference to
glfwCreateWindow’
undefined reference toglfwTerminate' undefined reference to
glfwMakeContextCurrent’
undefined reference toglfwWindowShouldClose' undefined reference to
_imp__glClear@4’
undefined reference toglfwSwapBuffers' undefined reference to
glfwPollEvents’
undefined reference to `glfwTerminate’
I actually have no idea what extra steps I need to take, and whether or not I need to add new lines in CMakeLists.txt or download/include additional libraries/binaries. Any help is appreciated, as I’m completely new to the whole thing. There doesn’t seem to be very many online tutorials either.
Also, if it’s relevant at all, I’m using CLion as my IDE.