OpenGL wih Qt5:#error gl.h包含在glew.h之前 [英] OpenGL wih Qt5: #error gl.h included before glew.h

查看:1076
本文介绍了OpenGL wih Qt5:#error gl.h包含在glew.h之前的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有项目在Qt4.8并试图用Qt5.1构建它。我收到很多

I have project on Qt4.8 and trying to build it with Qt5.1. I receive lots of

#error gl.h included before glew.h 

#error glext.h included before glew.h

错误。看起来像是OpenGL的Qt5的大变化..所有包括

errors. Seems like it was big changes in Qt5 with OpenGL.. All includes are

#include "GL/glew.h"
#include "GL/gl.h"
#include "GL/glu.h"

glew.h总是第一个。

glew.h is always the first.

推荐答案

h文件。头文件不是独立的。重要的是,从源文件中可以看到包括的顺序。

It doesn't matter whether the header is included first in some .h file. Header files are not standalone. What matters is the order that includes are seen from the source file.

你似乎有太多的头包含(一般来说,你应该保留头对头包含到绝对最小值)。没有什么可以做到我们的目的,以解决这个问题;你只需要解开你的标头问题。

You seem to have too many header inclusions (generally speaking, you should keep header-to-header inclusions to an absolute minimum). There's nothing that can be done on our end to fix that; you just need to untangle your header issues.

这篇关于OpenGL wih Qt5:#error gl.h包含在glew.h之前的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆