I have been trying to set up a graphics environment using GLFW following this tutorial on OpenGL:
https://www.youtube.com/watch?v=OR4fNpBjmq8&list=PLlrATfBNZ98foTJPJ_Ev03o2oq3-GGOS2&index=2
I have been having a great deal of trouble installing the GLFW library using CLion and by extension CMake, but I finally thought I had it ready using the information here:
https://www.glfw.org/docs/latest/build_guide.html#build_link_win32
until I used the sample code given by GLFW here:
https://www.glfw.org/documentation.html
Before, when I had it installed incorrectly, each function had an undefined reference, but now the only error I have is:
C:/path/to/project/main.cpp:28: undefined reference to `_imp__glClear@4'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
(I am using Windows 10, with an up to date version of CLion & GLFW, the only includes I am currently using are iostream, GLFW3.h, and gl.h)
Before I tried using the direct binaries, before switching to the source code, trying both on MinGW and Visual Studio toolchains, doing dynamic then static linking, and several other processes which I likely don’t remember well enough to explain. I feel like I am missing something an experienced programmer would see in an instant, but I honestly have no idea.
William Dappen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.