Skip to content

Instantly share code, notes, and snippets.

@pgmrDohan
Last active June 1, 2024 15:25
Show Gist options
  • Select an option

  • Save pgmrDohan/63eb4f7acb5a160eb0dfdf7102a57185 to your computer and use it in GitHub Desktop.

Select an option

Save pgmrDohan/63eb4f7acb5a160eb0dfdf7102a57185 to your computer and use it in GitHub Desktop.

SDL2 Development Setting on Windows

1. Using MinGW-w64
2. Using Cigwin

Using MinGW-w64

  1. Download MinGW-w64 in sourceforge.

image

  1. Extract "mingw64" folder in C:\.
  2. Download SDL2 Devel on github.

image

  1. Extract all folders in "x86_64-w64-mingw32" to "C:\mingw64".
  2. Add environment value "C:\mingw64\bin" on PATH.
  3. Add environment value "C:\mingw64\include" on C_INCLUDE_PATH.
  4. Build with gcc <file> -lmingw32 -lSDL2main -lSDL2.

Using Cygwin

  1. In Cygwin Setup, Select below packages
mingw64-x86_64-gcc-[core, g++]
mingw64-x86_64-SDL2
  1. Extract "sdl2.dll" to cygwin bin folder which in environment.

image

  1. Build with x86_64-w64-mingw32-gcc <file> -lmingw32 -lSDL2main -lSDL2.

TIP) copy&paste "x86_64-w64-mingw32-gcc" and rename to "gcc"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment