# GLFW undefined and linking errors with -lopengl32 -lglfw3 -lgdi32

**URL:** <https://discourse.glfw.org/t/glfw-undefined-and-linking-errors-with-lopengl32-lglfw3-lgdi32/2604>\
**Category:** support\
**Created:** [April 18, 2024, 7:11pm UTC](https://discourse.glfw.org/t/glfw-undefined-and-linking-errors-with-lopengl32-lglfw3-lgdi32/2604 "2024-04-18T19:11:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skye105](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@Skye105](https://discourse.glfw.org/u/Skye105)\
**Post date:** [April 18, 2024, 7:11pm UTC](https://discourse.glfw.org/t/glfw-undefined-and-linking-errors-with-lopengl32-lglfw3-lgdi32/2604/1 "2024-04-18T19:11:29Z")

</div>

so, i’m using gcc program.c -o test -LGLFW -lopengl32 -lglfw3 -lgdi32 to compile my program on windows, it doesn’t work, it gives me a bunch of undefined errors and i really don’t know what to do anymore

---

<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:** [April 19, 2024, 9:04am UTC](https://discourse.glfw.org/t/glfw-undefined-and-linking-errors-with-lopengl32-lglfw3-lgdi32/2604/2 "2024-04-19T09:04:43Z")

</div>

Hi @Skye105,

The first place to start would be our documentation:

[https://www.glfw.org/docs/latest/build\_guide.html#build\_link\_mingw](https://www.glfw.org/docs/latest/build_guide.html#build_link_mingw)

Note that if you are using OpenGL the command line will also need -lopengl32 added.
