# Error compiling glfw

**URL:** <https://discourse.glfw.org/t/error-compiling-glfw/1856>\
**Category:** support\
**Created:** [May 15, 2021, 4:28am UTC](https://discourse.glfw.org/t/error-compiling-glfw/1856 "2021-05-15T04:28:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [May 15, 2021, 1:38pm UTC](https://discourse.glfw.org/t/error-compiling-glfw/1856/2 "2021-05-15T13:38:55Z")

</div>

Hi @xxidk82xx,

Welcome to the GLFW forum!

See [my reply here to another post on compiling with MinGW](https://discourse.glfw.org/t/glfw-doesnt-seem-to-be-linking-properly-with-mingw-w64/1854/2).

In short you need to link with the glfw3 library, and since you are using OpenGL you also need to link against opengl32.lib, you may also need to link against other Windows libraries explicitly as per [the GLFW documentation](https://www.glfw.org/docs/latest/build_guide.html#build_link_win32).

To [link a library with g++ this guide might be helpful](https://www3.ntu.edu.sg/home/ehchua/programming/cpp/gcc_make.html#zz-1.8).

---

_[View the full topic](https://discourse.glfw.org/t/error-compiling-glfw/1856)._
