glew\glew.h:85: error: C1189: #error: gl.h included before glew.h

网友投稿 866 2022-11-20

glew\glew.h:85: error: C1189: #error: gl.h included before glew.h

glew\glew.h:85: error: C1189: #error:  gl.h included before glew.h

glew\glew.h:85: error: C1189: #error:  gl.h included before glew.h

原因

头文件包含顺序导致,qt中使用opengl的话头文件书写顺序错误的话会报告这个错误,这时需要保证

#include #include #include #include #include #include

#include "glew/glew.h"#include "glfw/glfw3.h"#include "glm/glm.hpp"#include "glm/gtc/matrix_transform.hpp"#include "glm/gtc/type_ptr.hpp"

以上头文件的后面

解决

#include "glew/glew.h"#include "glfw/glfw3.h"#include "gl/GLU.h"#include "glm/glm.hpp"#include "glm/gtc/matrix_transform.hpp"#include "glm/gtc/type_ptr.hpp"#include "camera.h"#include "shader.h"#include #include #include #include #include #include

另外:如果包含了  glew.h头文件,就不要在包含glad.h头文件

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:着色器语言第三版笔记(第一章)
下一篇:QtCreator 12.9中找不到调试器
相关文章

 发表评论

暂时没有评论,来抢沙发吧~