Glfw with cygwin

I am trying to build glfw with cygwin but got an error

../src/glfw3.lib(win32_monitor.c.obj):win32_monitor.c:(.text+0x8a): undefined reference to `__imp_CreateDCW'
../src/glfw3.lib(win32_monitor.c.obj):win32_monitor.c:(.text+0x8a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_CreateDCW'

Can someone help me here ?

Building GLFW with cygwin is a relatively advanced subject, and I recommend you have a full understanding of the documentation on compiling GLFW. if you’re just looking to compile a GLFW app on Windows then Microsoft Visual Studio has a free community edition.

This post indicates that you should be able to compile on cygwin using the same cmake build process as for Linux. Your errors indicate that you are compiling the source code intended for the Windows API, and although cygwin runs on Windows it offers a POSIX API including a X server.

1 Like