# Building 32bit libraries on a 64bit ubuntu

**URL:** <https://discourse.glfw.org/t/building-32bit-libraries-on-a-64bit-ubuntu/680>\
**Category:** support\
**Created:** [June 14, 2016, 9:30am UTC](https://discourse.glfw.org/t/building-32bit-libraries-on-a-64bit-ubuntu/680 "2016-06-14T09:30:11Z")\
**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 16, 2016, 1:05pm UTC](https://discourse.glfw.org/t/building-32bit-libraries-on-a-64bit-ubuntu/680/2 "2016-06-16T13:05:43Z")

</div>

I don’t have any of my Linux environments with me at the moment, but have you tried [this stackoverflow answer on 32bit compilation on a 64bit machine with gcc/cmake](http://stackoverflow.com/questions/1272357/how-to-compile-a-32-bit-binary-on-a-64-bit-linux-machine-with-gcc-cmake) ?

Alternatively, if you use add\_subdirectory( glfw ) to include the glfw cmake project in your projects cmake file then I think the build flag -m32 should carry over. Note you need glfw to be a subdir of your project above where you have the cmakelists.txt file.

---

_[View the full topic](https://discourse.glfw.org/t/building-32bit-libraries-on-a-64bit-ubuntu/680)._
