I am not sure what to do, I have added the include / lib files in the IDE include / lib folders. But I am getting these errors. Someone please help me! What am I doing wrong? Do I need to add some more code or what?


Error C1189   #error:  OpenGL header already included, remove this include, glad already 
provides it OpenGLSetup   
c:\program files (x86)\microsoft visual studio 14.0\vc\include\glad.h 26

Error (active)        #error directive: OpenGL header already included, remove 
this include, glad already provides it    OpenGLSetup 
c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\glad.h 26


Here is a link to the project on gitub: https://github.com/Kraycon/OpenGLSetup

  • \$\begingroup\$ 1. Code and errors should be shared as text, not as images. This both makes them easier to read, and also searchable so that folks with similar problems / experts with relevant skills can find your question. 2. Did you try removing the redundant include directive as the error message instructed you to, and verifying that the source files it's complaining about are in the indicated folders? \$\endgroup\$
    – DMGregory
    Commented Sep 15, 2017 at 17:12
  • \$\begingroup\$ Hi, I got rid of two errors but I am not sure what is means by remove the include. Where is teh OpenGL include? \$\endgroup\$ Commented Sep 15, 2017 at 17:55
  • \$\begingroup\$ @KrayconStudios "remove" - abolish or get rid of, "include" - (here) A preprocessor in the c++ language that tells the compiler to insert the specified file to the position of the preprocessor statement \$\endgroup\$
    – Bálint
    Commented Sep 15, 2017 at 17:58
  • 1
    \$\begingroup\$ Please include the faulty code into the question: you'll keep on working on your project, fixing your issues. Your linked project will be completely irrelevant to future readers of this site, making this question completely useless for future readers. \$\endgroup\$
    – Vaillancourt
    Commented Sep 15, 2017 at 20:52

2 Answers 2


TL;DR: #define GLFW_INCLUDE_NONE before including GLFW, or include glad bfore including glfw.

When you get these errors, the first thing to do is search for where the message is being generated:


Okay, so Glad is telling you not to include OpenGL headers yourself because Glad already provides it.

But, uh, you're not including OpenGL ... so something else is including it. Searching for "#include .*gl.h" gets you to


ah, GLFW includes OpenGL/gl.h among a bunch of other opengl-related headers. A look at GLFW's docs (http://www.glfw.org/docs/3.1/build.html) shows

If you are using an OpenGL extension loading library such as glad, the extension loader header should either be included before the GLFW one, or the GLFW_INCLUDE_NONE macro (described below) should be defined.


The OpenGL header is already included as part of glfw3. Swap the first two lines of your program and pray glfw3 does not care that glad has included the OpenGL header.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .