This is what it said:
C:\Users\COOLSH~1\AppData\Local\Temp\ccyGRAnW.o:main.c:(.text+0x17): undefined reference to glfwInit' C:\Users\COOLSH~1\AppData\Local\Temp\ccyGRAnW.o:main.c:(.text+0x51): undefined reference to glfwCreateWindow’
C:\Users\COOLSH~1\AppData\Local\Temp\ccyGRAnW.o:main.c:(.text+0x5f): undefined reference to glfwTerminate' C:\Users\COOLSH~1\AppData\Local\Temp\ccyGRAnW.o:main.c:(.text+0x74): undefined reference to glfwMakeContextCurrent’
C:\Users\COOLSH~1\AppData\Local\Temp\ccyGRAnW.o:main.c:(.text+0x100): undefined reference to glfwSwapBuffers' C:\Users\COOLSH~1\AppData\Local\Temp\ccyGRAnW.o:main.c:(.text+0x105): undefined reference to glfwPollEvents’
C:\Users\COOLSH~1\AppData\Local\Temp\ccyGRAnW.o:main.c:(.text+0x110): undefined reference to glfwWindowShouldClose' C:\Users\COOLSH~1\AppData\Local\Temp\ccyGRAnW.o:main.c:(.text+0x11d): undefined reference to glfwTerminate’
Also I feel like i’m doing something wrong here, cause my post keep getting flagged is it because I need to take it to Pm’s or something?
Hello! I wrote gcc main.c libglfw3.a -lopengl32 -lkernel32 -luser32 -lgdi32 -lws2_32 and I got linker error telling me that it can’t find glfw functions. I have libglfw3.a file in the same directory in which main.c is. What should I do?
The most common error with MinGW (it looks like you are using that) is that you need to use the correct bit GLFW library, which depends on which MinGW you are using and not on which version of Windows you are using.
So if you have the 64bit version of MinGW you need the 64bit download, otherwise the 32bit download. So if you have Windows 64bit but have MinGW 32 bit then you need the 32bit binaries or switch to 64bit MinGW.
If you are still stuck you could try using the following cmake GLFW starter which has everything you need set up:
I would also recommend using Visual Studio Community edition as the free native compiler on Windows over MinGW unless you are an expert.