<p>GLAD is <em>designed</em> around you simply including it directly in your project. That's the point of it; it is easy to use because you don't have to deal with any external dependencies. No messy libraries or DLLs to generate. It's just another source/header file in your build process.</p>

<p>Furthermore, your code will (presumably) be written to expect GLAD generation with a specific OpenGL version and set of extensions. If you require the user to use GLAD to generate the file, you also have to tell them what version+extensions to use, or else your code won't compile. If you just ship the GLAD-generated files with your program, there's no chance of breakage (or at least, you could detect the breakage because your own build doesn't work anymore).</p>

CC BY-SA 4.0
2018-11-07T15:43:31.950Z
2018-11-07T15:43:31.950Z
Nicol Bolas
<p>I have a modern OpenGL project hosted publicly.  I want to create the easiest experience so someone can just clone the repo and have it just work.</p>

<p>So far, I have included (as git submodules) the window creation library GLFW and the image loading library which is header only.</p>

<p>The only other part I have to handle is the OpenGL function loading part.  During development I have been using the webservice offered by <a href="https://github.com/Dav1dde/glad" rel="nofollow noreferrer">glad</a></p>

<p>The two files I need from GLAD are roughly ~10k lines each.</p>

<p>Other than asking a user to downloading these files  and place them in the correct folder themselves, is there any way to get around including these files directly in my project?</p>

<p>Are there any other drawbacks to included the function loading code directly in my project?</p>

<opengl>
How to include OpenGL extension loader in my project
Startec
# How to include OpenGL extension loader in my project

(Asked by: username_0 on 2018-11-07)

I have a modern OpenGL project hosted publicly. I want to create the easiest experience so someone can just clone the repo and have it just work.

So far, I have included (as git submodules) the window creation library GLFW and the image loading library which is header only.

The only other part I have to handle is the OpenGL function loading part. During development I have been using the webservice offered by [glad](https://github.com/Dav1dde/glad)

The two files I need from GLAD are roughly ~10k lines each.

Other than asking a user to downloading these files and place them in the correct folder themselves, is there any way to get around including these files directly in my project?

Are there any other drawbacks to included the function loading code directly in my project?

**Tags:** opengl


---

## 1 answers

### Answer by username_1 on 2018-11-07. Score: 1

GLAD is *designed* around you simply including it directly in your project. That's the point of it; it is easy to use because you don't have to deal with any external dependencies. No messy libraries or DLLs to generate. It's just another source/header file in your build process.

Furthermore, your code will (presumably) be written to expect GLAD generation with a specific OpenGL version and set of extensions. If you require the user to use GLAD to generate the file, you also have to tell them what version+extensions to use, or else your code won't compile. If you just ship the GLAD-generated files with your program, there's no chance of breakage (or at least, you could detect the breakage because your own build doesn't work anymore).


---

