【发布时间】:2013-03-06 22:33:35
【问题描述】:
我有 Qt4.8 上的项目并尝试使用 Qt5.1 构建它。我收到很多
#error gl.h included before glew.h
和
#error glext.h included before glew.h
错误。似乎在 Qt5 中使用 OpenGL 发生了很大的变化。所有包含的内容都是
#include "GL/glew.h"
#include "GL/gl.h"
#include "GL/glu.h"
glew.h 总是第一个。
【问题讨论】:
-
您是否首先添加了包含
gl.h在内的其他内容?也许像 Qt 头文件? GLEW 应放在其中任何一个之前。 -
@NicolBolas 不,#include "GL/glew.h" 总是第一个
-
可能是预编译的头文件?
-
@dowhilefor 未使用
-
同时检查您的 cpps,阅读 this 答案上的 cmets,也许会有所帮助。