# Compiling for 32-bit

**URL:** <https://discourse.glfw.org/t/compiling-for-32-bit/1346>\
**Category:** support\
**Created:** [June 12, 2019, 1:58am UTC](https://discourse.glfw.org/t/compiling-for-32-bit/1346 "2019-06-12T01:58:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vscottgordon](https://avatars.discourse-cdn.com/v4/letter/v/a87d85/32.png) [@vscottgordon](https://discourse.glfw.org/u/vscottgordon)\
**Post date:** [June 12, 2019, 1:58am UTC](https://discourse.glfw.org/t/compiling-for-32-bit/1346/1 "2019-06-12T01:58:45Z")

</div>

I used to be able to follow the steps using CMake and VS to compile GLFW to 32-bit.  
Now it seems that CMake generates a .sln file that is fixed at 64-bit.  
Is there a straightforward way of compiling GLFW using CMake/VS, to 32-bit ?  
Thanks!

---

<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, 2019, 12:09pm UTC](https://discourse.glfw.org/t/compiling-for-32-bit/1346/2 "2019-06-12T12:09:16Z")

</div>

You need to specify the generator and architecture for cmake to get either a 32bit or 64bit solution, although it is possible to by hand change a 32bit or 64bit project setup it’s a bit fiddly.

See the cmake documentation for the generator for the visual studio version you want to compile with:  
[https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html)

---

<div class="post-metadata">

**Author:** ![elmindreda](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/elmindreda/32/26_2.png) [@elmindreda](https://discourse.glfw.org/u/elmindreda)\
**Post date:** [June 17, 2019, 2:34pm UTC](https://discourse.glfw.org/t/compiling-for-32-bit/1346/3 "2019-06-17T14:34:49Z")

</div>

What @dougbinks said. Also, if you’re using the CMake GUI then you can choose in the _Optional platform for generator_ drop down menu.

CMake used to default to 32-bit for Visual Studio but changed it to 64-bit for VS 2019.
