# Errors setting up opengl, glad, and glfw

**URL:** <https://discourse.glfw.org/t/errors-setting-up-opengl-glad-and-glfw/2817>\
**Category:** support\
**Created:** [January 13, 2025, 5:23am UTC](https://discourse.glfw.org/t/errors-setting-up-opengl-glad-and-glfw/2817 "2025-01-13T05:23:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidNodeB](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/davidnodeb/32/983_2.png) [@DavidNodeB](https://discourse.glfw.org/u/DavidNodeB)\
**Post date:** [January 13, 2025, 5:23am UTC](https://discourse.glfw.org/t/errors-setting-up-opengl-glad-and-glfw/2817/1 "2025-01-13T05:23:02Z")

</div>

# Steps I did

1. installed glfw source zip
2. used cmake to create a build folder with glfw3.lib inside of it
3. created a folder in my c drive called opengl and make two folders inside of it called include and lib
4. installed glad zip from here [https://glad.dav1d.de/](https://glad.dav1d.de/) with gl on 3.3 and profile on core
5. copied both include folders from glad over to my opengl folder and added glfw3.lib to my lib folder
6. Went to vc++ dir and added `C:\OpenGL\lib` in the library dir
7. Went to vc++ dir and added `C:\OpenGL\include` in the include dir
8. Went to linker \> input \> additional dependencies and added `glfw3.lib` and `opengl32.lib`
9. created main.cpp and added this into it `#include <glad/glad.h> `

now I am getting this error when i build `unresolved external symbol main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)` and this error `1 unresolved externals`

PLEASE HELP

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [January 13, 2025, 5:21pm UTC](https://discourse.glfw.org/t/errors-setting-up-opengl-glad-and-glfw/2817/2 "2025-01-13T17:21:16Z")

</div>

Your source file `main.cpp` needs to include an `int main() {}` function. [A basic GLFW would look like the one in the documentation](https://www.glfw.org/docs/latest/quick_guide.html#quick_example).
