# Could not link with glfw on windows

**URL:** <https://discourse.glfw.org/t/could-not-link-with-glfw-on-windows/1584>\
**Category:** support\
**Created:** [June 12, 2020, 10:21am UTC](https://discourse.glfw.org/t/could-not-link-with-glfw-on-windows/1584 "2020-06-12T10:21:34Z")\
**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:** [June 12, 2020, 10:48am UTC](https://discourse.glfw.org/t/could-not-link-with-glfw-on-windows/1584/2 "2020-06-12T10:48:18Z")

</div>

Is this the full list of warnings and errors from the linking, or do you also see LNK4098 or LNK4286 warnings?

It could be that you have compiled GLFW with one run-time library and are linking with another. See:

> **[Linker Tools Warning LNK4098](https://learn.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-warning-lnk4098?view=msvc-170&viewFallbackFrom=vs-2019)**
>
> Describes how incompatible libraries cause linker tools warning LNK4098, and how to use /NODEFAULTLIB to fix it.

and forum post answer:

> [@Setting Up GLFW on Visual Studio](https://discourse.glfw.org/t/setting-up-glfw-on-visual-studio/1344/4):
>
> That option doesn’t control whether a DLL is generated as output but rather which version of the C++ runtime library is used: static or DLL. The pre-compiled GLFW static library in the package you downloaded was compiled for Multithreaded DLL and will only work with that setting. This error means that the GLFW static library file you are using is calling the C++ library function free as if it’s in a DLL but you are then linking the whole application with the static library form (i.e. Multithr…

Using Clang to compile on Windows via the command line is fairly advanced. If you want to get up and running quickly with a basic example try:

> **[GitHub - juliettef/GLFW-CMake-starter: Use CMake to create a project with GLFW...](https://github.com/juliettef/GLFW-CMake-starter)**
>
> Use CMake to create a project with GLFW - Multi-platform Windows, Linux and MacOS. - GitHub - juliettef/GLFW-CMake-starter: Use CMake to create a project with GLFW - Multi-platform Windows, Linux a...

---

_[View the full topic](https://discourse.glfw.org/t/could-not-link-with-glfw-on-windows/1584)._
