Qt OpenGL 问题汇总
-
qopenglwidget.h: No such file or directory
.pro文件中增加 QT += opengl -
error: ‘setCaption’ was not declared in this scope
将setCaption函数替换为setWindowTitle -
error: ‘gluPerspective’ was not declared in this scope
增加头文件#include<gl/glu.h> -
invalid use of imcomplete type 'class QKeyEvent’
添加头文件#include < QKeyEvent> -
qt opengl 的 undefined reference to `__imp_glClearColor
.pro添加以下库
win32:LIBS += -lOpengl32 -lglu32
unix:LIBS += -lglut -lGLU -
error C2144: 语法错误 : “void”的前面应有“;”
#include <windows.h> //加上这一句,注意头文件的顺序 -
warning C4100: “argv”: 未引用的形参
UNREFERENCED_PARAMETER(argv);