Recently, when Window7 was using Qt5.2 to learn OpenGL, there were errors that could not be used by libraries that begin with Glu in OpenGL, for example: ' gluperspective ' is not declared in this Scope. The QT version used in this article is Qt 5.2.0 for Windows 32-bit (MinGW 4.8, OpenGL, 689 MB)(info), you can see the QT version download information on various platforms from the QT website http://qt-project.org/downloads.
Internet search the following related solutions, are for QT low version, such as this article: QT Common error Glu header file is not available. I tried it and finally solved the problem under the QT5.2 environment under the WINDOW7.
1. Add a header file in the source file that references the Glu function library similar to the gluperspective function: #include <gl/glu.h>
This step must be, do not know why the use of OpenGL under the QT5.2 Glu beginning with the GLU32 library also need to include gl/glu.h header file, and using OpenGL in the OPENGL32 library with GL Start does not need to include the header file.
2, download Glut.lib and glut32.lib These two library files, copy them to your QT installation directory under the Qt5.2.0\5.2.0\mingw48_32\lib folder, so the QT compiler automatically to the Lib directory to search the corresponding library files, that is the implementation of the Glu function library.
This step may not be required.
Finally, in my Qt5.2 environment, I tried the OpenGL programming under QT (2) to build the OpenGL programming framework under QT This post and the C + + GUI programming with QT4 (2nd edition) 20th chapter of the Triangle Cone tetrahedron OpenGL example, confirmed that the above configuration, gluperspective (45.0, (glfloat) width/(glfloat) height,0.1,100.0); and Glupickmatrix (Gldouble (Pos.x ()), Gldouble (Viewport[3]-pos.y ()), 5.0,5.0,viewport); These two lines of code work.
Win7 Qt5.2 in the Glu library using OpenGL