I’m on Windows 10 and using MinGW to use gcc. I’m using the code on http://www.glfw.org/documentation.html right now. I’m compiling it with gcc main.c -o main.exe -lglfw3
.
But then I get this:
(I replaced my long path behind main.c just with “longpath”)
longpath:main.c:(.text+0x17): undefined reference to `glfwInit'
longpath:main.c:(.text+0x51): undefined reference to `glfwCreateWindow'
longpath:main.c:(.text+0x5f): undefined reference to `glfwTerminate'
longpath:main.c:(.text+0x71): undefined reference to `glfwMakeContextCurrent'
longpath:main.c:(.text+0x7f): undefined reference to `_imp__glClear@4'
longpath:main.c:(.text+0x8f): undefined reference to `glfwSwapBuffers'
longpath:main.c:(.text+0x94): undefined reference to `glfwPollEvents'
longpath:main.c:(.text+0x9f): undefined reference to `glfwWindowShouldClose'
longpath:main.c:(.text+0xa8): undefined reference to `glfwTerminate'
collect2.exe: error: ld returned 1 exit status
I also tried running with gcc main.c -o main.exe -lglfw3 -lglfw3dll
. But that gave the same result.
So it’s probably missing something.
What should I do?
My topic pretty much equals Linking libraries if that helps