A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
Hello @Sid Kraft ,
It appears the semicolon after void display(void); turns it into a function declaration rather than a definition, which likely causes the linker error. Removing the semicolon is the expected approach. If you see an error at { after removing it, this suggests there might be another syntax issue slightly earlier in your file.
Additionally, glutInit is a built-in library function meant to be called, not redefined. It might be beneficial to move your window initialization code and the return 0; statement into a standard int main(int argc, char** argv) function.
Below is a structure you could try:
void display(void)
{
glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
glFlush();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH);
glutInitWindowPosition(100, 200);
glutInitWindowSize(800, 700);
glutCreateWindow("This is a window title");
glutDisplayFunc(display);
glutIdleFunc(display);
glutMainLoop();
return 0;
}
Let me know if this helps resolve the build issues. If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.
Thank you.