# Setting Up GLFW

**URL:** <https://discourse.glfw.org/t/setting-up-glfw/2383>\
**Category:** support\
**Created:** [May 28, 2023, 4:55am UTC](https://discourse.glfw.org/t/setting-up-glfw/2383 "2023-05-28T04:55:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MythoRED](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@MythoRED](https://discourse.glfw.org/u/MythoRED)\
**Post date:** [May 28, 2023, 4:55am UTC](https://discourse.glfw.org/t/setting-up-glfw/2383/1 "2023-05-28T04:55:15Z")

</div>

So Added all the additional libraries but still get error in the output:

```auto
1>------ Build started: Project: Learning1, Configuration: Debug Win32 ------
1>Application.obj : error LNK2019: unresolved external symbol _glfwInit referenced in function _main
1>Application.obj : error LNK2019: unresolved external symbol _glfwTerminate referenced in function _main
1>Application.obj : error LNK2019: unresolved external symbol _glfwCreateWindow referenced in function _main
1>Application.obj : error LNK2019: unresolved external symbol _glfwWindowShouldClose referenced in function _main
1>Application.obj : error LNK2019: unresolved external symbol _glfwPollEvents referenced in function _main
1>Application.obj : error LNK2019: unresolved external symbol _glfwMakeContextCurrent referenced in function _main
1>Application.obj : error LNK2019: unresolved external symbol _glfwSwapBuffers referenced in function _main
1>N:\OpenGL\Learning\Learning1\Dependencies\GLFW\lib-vc2022\glfw3.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
1>N:\OpenGL\Learning\Learning1\Debug\Learning1.exe : fatal error LNK1120: 7 unresolved externals

```

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/88251ee998d865924f68e34d6473e78045e6047a.png)

---

<div class="post-metadata">

**Author:** ![mmozeiko](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/mmozeiko/32/29_2.png) [@mmozeiko](https://discourse.glfw.org/u/mmozeiko)\
**Post date:** [May 28, 2023, 6:32am UTC](https://discourse.glfw.org/t/setting-up-glfw/2383/2 "2023-05-28T06:32:10Z")

</div>

`warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'`

This means that glfw3.lib you’re using is built for 64-bit code. But the code you are linking is built as 32-bit code - the `Win32` selection on `Platform` drop-down means you’re looking at 32-bit build. Either switch to `x64` platform to build 64-bit code. Or get 32-bit glfw3.lib file if you want to build 32-bit executable.

---

<div class="post-metadata">

**Author:** ![MythoRED](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@MythoRED](https://discourse.glfw.org/u/MythoRED)\
**Post date:** [May 28, 2023, 7:15am UTC](https://discourse.glfw.org/t/setting-up-glfw/2383/3 "2023-05-28T07:15:06Z")

</div>

Thank you so much, I accidently downloaded the 64-bit code instead of the 32-bit. Thanks once again 😃

---

<div class="post-metadata">

**Author:** ![jokoon](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/jokoon/32/899_2.png) [@jokoon](https://discourse.glfw.org/u/jokoon)\
**Post date:** [April 18, 2024, 4:23pm UTC](https://discourse.glfw.org/t/setting-up-glfw/2383/4 "2024-04-18T16:23:15Z")

</div>

Isn’t it possible to build GLFW in 32 bit? I change the compiler in the visual studio setting, it doesn’t build in x86. By default, there is no x86 drop down menu in visual studio.

Am I missing something?

I have cmake 3.27.6.

---

<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 18, 2024, 4:54pm UTC](https://discourse.glfw.org/t/setting-up-glfw/2383/5 "2024-04-18T16:54:01Z")

</div>

Hi @jokoon,

Welcome to the GLFW forum.

CMake has recently switched to defaulting the Visual Studio generator to 64bit. To select 32bit you need to specify the target platform, for example with `-A Win32`.

See:  
[https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html](https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html)
