# Compile 32bit library for MinGW64 compiler

**URL:** <https://discourse.glfw.org/t/compile-32bit-library-for-mingw64-compiler/119>\
**Category:** support\
**Created:** [January 16, 2015, 9:09pm UTC](https://discourse.glfw.org/t/compile-32bit-library-for-mingw64-compiler/119 "2015-01-16T21:09:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [January 16, 2015, 9:09pm UTC](https://discourse.glfw.org/t/compile-32bit-library-for-mingw64-compiler/119/1 "2015-01-16T21:09:19Z")

</div>

**[hepple](https://sourceforge.net/u/hepple/)** wrote on [Friday, January 16, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/9c274b45/#4ed9):

I am having trouble building the GLFW library.

I can use the precompiled 32 bit windows binaries with 32 bit MinGW32 bit generated code.  
I can use the precompiled 64 bit windows binaries with 64 bit MinGW64 bit generated code.  
I have also downloaded the source code and can get the above working by building the source code.

What I can’t do is build a 32bit GLFW library using the MinGW64 bit compiler. Whenever I try to link to the 32 bit libraries I get a compatibility error. I am using GCC version 4.8.2 with MinGW32 and GCC version 4.9.2 with MinGW64.

I can’t see a way to tell cMake which version (32 or 64 bit) libraries to compile. Is there a way to do this?
