OpenGL learning — problems encountered in compiling OpenGL program for the first time

The first time you compile and run an OpenGL program, you run into a bug that makes you crazy.
It looks like this:

A lot of search on the Internet, found that this is the first time to compile OpenGL program will meet the error. The solution is as simple as the #include< gl/glut.h> Preface it with a code like this:

Also note that the order of the code must be in #include< gl/glut.h> Before, can not error, otherwise still can not pass.

Read More: