A week ago, when I first tried to work with GLUT and followed this tutorial it worked without any errors. Now, a week later I installed the same software, same libraries, but every time I try to compile the project I get these errors (and it highlights a line in the glut.h file):
obj\Debug\main.o(.text+0x1c)||In function `glutInit_ATEXIT_HACK':|
C:\Program Files\CodeBlocks\MinGW\include\GL\glut.h|486|undefined reference to `__glutInitWithExit@12'|
obj\Debug\main.o(.text+0x3d)||In function `glutCreateWindow_ATEXIT_HACK':|
C:\Program Files\CodeBlocks\MinGW\include\GL\glut.h|503|undefined reference to `__glutCreateWindowWithExit@8'|
obj\Debug\main.o(.text+0x5d)||In function `glutCreateMenu_ATEXIT_HACK':|
C:\Program Files\CodeBlocks\MinGW\include\GL\glut.h|549|undefined reference to `__glutCreateMenuWithExit@8'|
I uninstalled Code:Blocks, deleted the GLUT files (glut.h, glut32.dll, glut.a) and reinstalled everything, but I still get the same errors. I'm completely sure my linker settings are OK since I've followed the tutorial. I also tried other tutorials, but get the same results, a bunch of errors.
What am I doing wrong, and how can I fix it?
Edit: Fixed! All that was needed was #include <GL/gl.h> before including GL/glut.h.