我在Qt4.8上有項目並試圖用Qt5.1構建它。我收到很多OpenGL與Qt5:#error gl.h包含在glew.h之前
#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應該包含在其中任何一個之前。 – 2013-03-18 14:39:07
@NicolBolas不,#include「GL/glew.h」永遠是第一個 – Littlebitter 2013-03-18 14:39:47
預編譯頭文件嗎? – dowhilefor 2013-03-18 14:45:28