This project requires 64-bit MinGW-w64 to build, as the SDL2 libraries are compiled for 64-bit Windows.
- Download and install MSYS2 from: https://www.msys2.org/
- Open "MSYS2 MSYS" from the Start menu
- Update the package database:
pacman -Syu
- Install the toolchain:
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make
- Add
C:\msys64\mingw64\binto your system PATH
If you have MSYS2 installed in the default location (C:\msys64), you can simply run:
build.batThe script will automatically set up the correct paths and build the project.
build.bat- Ensure MinGW-w64 bin directory is in your PATH
- Navigate to the demo directory
- Run:
make
After a successful build, the executable will be in build\sgl_simulator.exe.
Run it with:
build\sgl_simulator.exeOr use the make target:
make runThis means you're using 32-bit MinGW instead of 64-bit MinGW-w64. Make sure you have the 64-bit version installed and it's first in your PATH.
MinGW is not in your PATH. Either:
- Use
build.batwhich handles this automatically - Add the MinGW-w64 bin directory to your system PATH
- Install MSYS2 and the required packages
To remove all build artifacts:
make cleanmain.c- Main application entry pointsgl_port_sdl2.c- SDL2 port implementationtest.c- Test codebg.c- Background rendering../sgl/- SGL library source codesdl/- SDL2 library (headers, import libraries, and DLL)build/- Output directory for compiled objects and executable