I am new to C++ and trying to create a window with OpenGL. My program gives the error undefined reference to 'glutSwapBuffers'. I did not understand why is it giving this error for hours but I just looked and saw that the glutSwapBuffers function is defined like this in my header file:
extern void APIENTRY glutSwapBuffers(void);
I edited the header and changed it to an example function and the function worked. I searched for GLUT and downloaded the header files that I found. Definition was always same.
I understood why does not my code work but I do not know why the glutSwapBuffers is defined like this. Do I need to include other libraries?
