Problems in setting up GLFW in CodeBlocks

1.1k views Asked by At

I downloaded GLFW 3.1.1 and followed a tutorial telling me to:

  1. Drop glfw3.h into MinGW's include folder
  2. Drop the contents of lib-mingw in the downloaded file into MinGW's lib folder
  3. Run the test program that comes with GLFW

After doing this I kept running into an error that stopped me from even starting a new GLFW project as the wizard kept looking for glfw.h and glfw.dll when they're now glfw3.h and glf3.dll I edited the wizard and was finally able to get the new project open.

After that, I clicked build and run and the compiler asked if I was sure. When I clicked yes it continually asked me if I wanted to build and run. The debugger just gives me this and I'm not sure what I set up wrong.

-------------- Build: Debug in 112311 (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -g -I"C:\Program Files\MinGW\include" -c "C:\Users\User\Desktop\Folders\C++ Files\112311\main.cpp" -o obj\Debug\main.o
Execution of 'mingw32-g++.exe -Wall -g -I"C:\Program Files\MinGW\include" -c "C:\Users\User\Desktop\Folders\C++ Files\112311\main.cpp" -o obj\Debug\main.o' in 'C:\Users\User\Desktop\Folders\C++ Files\112311' failed.

-------------- Run: Debug in 112311 (compiler: GNU GCC Compiler)---------------

Checking for existence: C:\Users\User\Desktop\Folders\C++ Files\112311\bin\Debug\112311.exe

i

1

There are 1 answers

0
FrostyZombi3 On

You should avoid using the wizard for GLFW projects because it's for an outdated version of GLFW.

You should create a console application then go to Project->Build Options. Go to the Linker settings tab then add glfw3, opengl32 and gdi32, then click OK.

You can now test if it worked by copying the sample code on the GLFW website's documentation page and pasting it in main.cpp, replacing everything and running the program.