Glad has bugs? strange problems


system: linux Mint, builing with codeblocks 16.01 full 64bit system
glwf compiled from source (no errors)

the sample give at i can compile without errors or warnings (great)

the sample located at “” is full of warnings like below

GLES3/gl31.h|528|error: ‘void glad_glActiveTexture(GLenum)’ redeclared as different kind of symbol|
/glfw-3.2.1/deps/glad/glad.h|2415|note: previous declaration ‘void (*glad_glActiveTexture)(GLenum)’

and it goes on and on (codeblocks stops at 50 errors)

it looks like glad.h has the GL definitions different to the GL standards (GLES2, 3, 3.1) is this a bug or am i doing some thing wrong…


NOTE: I edited your question to fix the links.

This example builds and runs fine for me on Windows using cmake.

This is probably a build related problem, so my first step would be to try to build GLFW and the examples by downloading the source package and compiling using cmake.

Once you can build and run the example code, you can alter one of the examples which uses glad (perhaps simple.c) with the code you linked to and build / run that.

If you can do this, then you can start to look at your codeblocks project settings to find out what’s wrong.


Compiled GLWF from source using cmake as i stated earlier
using the supplied cmake file i can compile the examples.
glfw work like a charm

glad seems to be a seperate item, it is not in the pkgconfig.pc file nor the include path

I dont want anything to to with cmake, i dont know it, and dont want to know,
its the same as using a matrix printer, it is not user friendly.

so the question is how can i use glad without cmake… using codeblocks


i got it working, took some fiddeling, but got it done… :slight_smile:

anybody in need of a simple project including projectfile for codeblocks?
send a message and i send the whole project directory to you

greetings, go on witrh the good work…


EDIT: looks like this was simultaneously posted at the same time as the above post with it working :slight_smile:

Excellent - so we now know that since you can complle and run (I presume?) the examples, both GLFW and Glad work fine on your system using the Glad.c/.h supplied with GLFW for the examples.

Glad is rather special in that it uses a generator to create the supplied files, for example from

For the basic test you want to do with codeblocks the supplied Glad loader with OpenGL 3.2 support which comes with GLFW source should work for you. To use this I would do the following:

  1. Starting from the working sample without glad, check you have it set up in Codeblocks so that it compiles and runs. Make sure you don’t have any directory settings pointing to an install of glad.
  2. Copy the glad.c and glad folder (with glad.h in) from your GLFW source which is in the deps folder into your project source folder, perhaps under a directory such as deps.
  3. Add these to your codeblocks project as you do with other source code. Since glad is usually include with #include <glad/glad.h> you should set the include directory to the one below the glad directory.
  4. Compile, and hopefully this should work.

The reason I suggest copying glad.c and glad.h is that you may need to overwrite these with ones you generate for your own project.

Good luck, please let me know how you get on with this.


Great, glad (pun intended) you have this working.

If you have a GIthub account perhaps post the project it there?