/* glClearColor (0.0, 0.0, 0.0, 0.0); */
/* set fill color to white */
/* glColor3f(1.0, 1.0, 1.0); */
/* set up standard orthogonal view with clipping */
/* box as cube of side 2 centered at origin */
/* This is default view and these statement could be removed */
/* Initialize mode and open a window in upper left corner of screen */
/* Window title is name of program (arg[0]) */
/* You must call glutInit before any other OpenGL/GLUT calls */
glutInit(&argc,argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(500,500);
glutInitWindowPosition(0,0);
glutCreateWindow("simple");
glutDisplayFunc(display);
init();
glutMainLoop();
}
and it does not work on my mac using xcode. It has 13 erros saying things like "_glBegin", referenced from:
display() in File.o and at the end the last error is linker command failed with exit code 1 (use -v to see invocation).
The bigger picture here is that you're trying to code in C++ without an understanding of what the tools do. You need to go back and learn what a compiler is and what it does to turn a single text file into a single binary object, and what a linker is and ow it turns many binary objects into a single library or executable.
If you knew the basics, you would ave been able to answer this question yourself. Understanding the basics will help you enormously in the future.