Raylib in Code::Blocks - a how to.

I figured out how to get Raylib to build in Code::Blocks so wanted to share.

First, under Project Settings check the box that says, "This is a custom Makefile".

Then, in your project's folder create a file named Makefile and paste the following.
files = main.c
output = main.exe

Debug:
gcc -g -o obj\Debug\$(output) $(files) \
c:\raylib\raylib\raylib_icon \
-Ic:\raylib\raylib\src \
-Lc:\raylib\MinGW\bin \
-Lc:\raylib\MinGW\include\GLFW \
-Iexternal -lraylib -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm \
-std=c99 -Wl,-allow-multiple-definition -Wl,--subsystem,windows -Wall

Release:
gcc -s -o obj\Debug\$(output) $(files) \
c:\raylib\raylib\raylib_icon \
-Ic:\raylib\raylib\src \
-Lc:\raylib\MinGW\bin \
-Lc:\raylib\MinGW\include\GLFW \
-Iexternal -lraylib -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm \
-std=c99 -Wl,-allow-multiple-definition -Wl,--subsystem,windows

cleanDebug:
del /F /Q obj\Debug\*.*

cleanRelease:
del /F /Q obj\Release\*.*
Change files and output variables as you see fit. Hope it helps.

Mark

Comments

  • Hey Mark! Thank you very much for the addition! I'll copy it to raylib wiki! :D
Sign In or Register to comment.