compile GLFW in cygwin

264 views Asked by At

I am trying to compile glfw with cygwin but getting errors like this

../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 here ? Anyone has successfull experience in compiling glfw with cygwin ?

1

There are 1 answers

0
The Parallax On

Have you linked the libraries opengl32 and glfw3dll? Also have you included glad.h in your code? If so you should also include windows.h. Include the files in this order:

#include <windows.h>
#include <path_to_glad/glad.h>
#include <path_to_glfw/glfw3.h>

Then compile the code like this:

gcc/g++ main.c glad.c -lglfw3dll -lopengl32

It would also be better if you included your code along with your question