/* Initialize mode and open a window in upper left corner of screen */
/* Window title is name of program (arg) */
/* You must call glutInit before any other OpenGL/GLUT calls */
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
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.