How do I compile the example on mingw-w64?

Hi @JamesCpp, welcome to the GLFW forums!

When compiling any program you need to tell the compiler the location of any include files or libraries by specifying search directories for these. To specify an include directory to search you use the -I[directory_name] option and for libraries you use -l[library] to specify the library and -L[library_dir] to specify the location. You don’t need to specify the library directory if you include the path to the library when specifying the library.

In your case if you correctly moved the include files and libraries you won’t need to specify the locations, but you will still need to specify the libraries. However it looks like you did not copy the include files to the correct location: the header glfw3.h should be in a directory GLFW in the MinGW include directory.

You will then need to ensure you link to GLFW and all the relevant libraries, which might be as follows:

g++ glfw.cpp -o glfw - lglfw3 -lopengl32 -lgdi32 -luser32 -lkernel32

You may not need the last three libraries, but it depends on your version of MinGW.

Let us know how this goes.