# Can't get GLFW working on Win10

**URL:** <https://discourse.glfw.org/t/cant-get-glfw-working-on-win10/1870>\
**Category:** support\
**Created:** [June 12, 2021, 3:08pm UTC](https://discourse.glfw.org/t/cant-get-glfw-working-on-win10/1870 "2021-06-12T15:08:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebekerga](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/sebekerga/32/532_2.png) [@Sebekerga](https://discourse.glfw.org/u/Sebekerga)\
**Post date:** [June 12, 2021, 3:08pm UTC](https://discourse.glfw.org/t/cant-get-glfw-working-on-win10/1870/1 "2021-06-12T15:08:17Z")

</div>

I’ve spent last 2 days googling and trying many options and yet didn’t manage to get GLFW working. I’m using CLion with CMake to build a simple program:

```auto
#define GLFW_INCLUDE_VULKAN
#include <glfw3.h>

#include <iostream>

int main() {
    glfwInit();
    return 0;
}

```

And I used to veriants of CMakeList.txt

1. Using GLFW Source Package:

```auto
cmake_minimum_required(VERSION 3.17)
project(ultima)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME} main.cpp )

set(GLFW_INCLUDE_DIRS C:/somewhere/tools/glfw-3.3.4/include/GLFW)
include_directories(${GLFW_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${GLFW_INCLUDE_DIRS}/glfw3.h)

```

With that I’m getting error like this:  
`main.cpp:13: undefined reference to `glfwInit’`

1. Using Windows Binaries:

```auto
cmake_minimum_required(VERSION 3.17)
project(ultima)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME} main.cpp )

set(GLFW_DLL_DIRS C:/somewhere/tools/glfw-3.3.4.bin.WIN64/lib-mingw-w64)
include_directories(${GLFW_DLL_DIRS})
target_link_libraries(${PROJECT_NAME} ${GLFW_DLL_DIRS}/libglfw3dll.a)

```

And with that I’m getting this:  
`main.cpp:2:10: fatal error: glfw3.h: No such file or directory`

At this point I have to ask this in related forums and I’m out of options to search for.

---

<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, 2021, 4:00pm UTC](https://discourse.glfw.org/t/cant-get-glfw-working-on-win10/1870/2 "2021-06-12T16:00:03Z")

</div>

Have you tried using:

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

I don’t know CLion very well, but this cmake package should work with the free Visual Studio Community edition.

---

<div class="post-metadata">

**Author:** ![Sebekerga](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/sebekerga/32/532_2.png) [@Sebekerga](https://discourse.glfw.org/u/Sebekerga)\
**Post date:** [June 12, 2021, 9:57pm UTC](https://discourse.glfw.org/t/cant-get-glfw-working-on-win10/1870/3 "2021-06-12T21:57:09Z")

</div>

That guide absolutely worked for me, thank you a lot for answering!

---

<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 13, 2021, 10:27am UTC](https://discourse.glfw.org/t/cant-get-glfw-working-on-win10/1870/4 "2021-06-13T10:27:17Z")

</div>

Excellent, glad this helped.
