Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

glad.h giving error that opengl header is included

Tags:

c++

I am trying to use glad.h with my code. I am programming on Visual Studio 2013. For some reason its giving me the error C1189: #error : OpenGL header already included, remove this include, glad already provides it
Can someone help me with this?

These are the headers that I am including:-

#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
like image 558
Jimmy V Avatar asked Jun 03 '17 15:06

Jimmy V


2 Answers

I just reversed the include order of glfw3.h and glad.h,like this:

#include <glad\glad.h>
#include <GLFW\glfw3.h>
like image 192
Ye.Feng Avatar answered Oct 25 '22 03:10

Ye.Feng


Using GLFW, adding GLFW_INCLUDE_NONE to Properties->C/C++->Preprocessor->Preprocessor Definitions fixed this

like image 9
cmdev Avatar answered Oct 25 '22 02:10

cmdev