# Compiling GLFW under windows with MinGW

**URL:** <https://discourse.glfw.org/t/compiling-glfw-under-windows-with-mingw/505>\
**Category:** support\
**Created:** [October 8, 2009, 7:07pm UTC](https://discourse.glfw.org/t/compiling-glfw-under-windows-with-mingw/505 "2009-10-08T19:07:48Z")\
**Posts on this page:** 4\
**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:** [October 8, 2009, 7:07pm UTC](https://discourse.glfw.org/t/compiling-glfw-under-windows-with-mingw/505/1 "2009-10-08T19:07:48Z")

</div>

**[axyde](https://sourceforge.net/u/axyde/)** wrote on [Thursday, October 08, 2009](https://sourceforge.net/p/glfw/discussion/247562/thread/2cc5ba9b/#e452):

Hi,

I want to compile GLFW (using MinGW under Windows). So i change to that  
directory and execute:  
`mingw32-make win32-mgw`

When I do that i get the error: `The command "." is either  
misspelled or could not be found. mingw32-make: \*\*\* Error 1`

So I opened the makefile and figured out that i actually cllas the following  
command:  
`compile.bat mingw32-make mgw`

So i executet that command and all worked like described in . But when i  
wanted to procced with "Step 3" i tried to execute  
`mingw32-make cygwin-install`

i get the ouput . So did i do anything wrong or can anyone provide Win32/MinGW  
binarys (.dll’s, .a’s and pkgconfig)? Sorry for my bad english …

Thanks, aXyde

: [http://glfw.sourceforge.net/release-2.6.html](http://glfw.sourceforge.net/release-2.6.html)  
: [http://pastebin.org/40187](http://pastebin.org/40187)

---

<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:** [October 8, 2009, 7:19pm UTC](https://discourse.glfw.org/t/compiling-glfw-under-windows-with-mingw/505/2 "2009-10-08T19:19:03Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Thursday, October 08, 2009](https://sourceforge.net/p/glfw/discussion/247562/thread/2cc5ba9b/#6ea9):

The MinGW make path in 2.6 is really broken and I’m not clever enough to make  
a usable installation of MinGW on my machine, so I’m not sure when this will  
change.

Hopefully, someone else on the forum knows more.

I do know, however, that the cygwin-install target assumes you’re using Cygwin  
and thus have a Unix-like set of tools. Plain old MinGW, as I understand it,  
does not.

---

<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:** [October 9, 2009, 10:24am UTC](https://discourse.glfw.org/t/compiling-glfw-under-windows-with-mingw/505/3 "2009-10-09T10:24:26Z")

</div>

**[axyde](https://sourceforge.net/u/axyde/)** wrote on [Friday, October 09, 2009](https://sourceforge.net/p/glfw/discussion/247562/thread/2cc5ba9b/#80ee):

After installing cygwin i was able to compile with “Makefile.win32.cywin  
install”. So can anyone tell me how i can now link my code so it uses the  
dynamic library? I tried “-lglfwdll” but then i get errors like  
"undefined reference to `xyzMethod’". So whats the right liner  
command for MinGW/cygwin/gcc?

---

<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:** [October 9, 2009, 11:04am UTC](https://discourse.glfw.org/t/compiling-glfw-under-windows-with-mingw/505/4 "2009-10-09T11:04:05Z")

</div>

**[axyde](https://sourceforge.net/u/axyde/)** wrote on [Friday, October 09, 2009](https://sourceforge.net/p/glfw/discussion/247562/thread/2cc5ba9b/#20e1):

Alright got i working now. For all people who search this: I just forgot to  
add "#define GLFW\_DLL" before the include of \<GL/glfw.h\>.
