This is setup guide for SDL2 project
Prequisites: SDL-2
, SDL-2-Image
To setup the nesscessary packages:
sudo apt-get update &&\
sudo apt-get install -y libsdl2-image-dev\
libsdl2-dev cmake build-essential --fix-missing
After install the developer versions of SDL2 and SDL2_image:
cd SDL2-Demo
mkdir build
cd build
cmake ..
make
./MyGame
Assuming CodeBlock 20.03 is installed (with MinGW64)
- Download the SDL-2 from this link SDL
- Extract the file, for example, to
C:\Users\ADMIN\Downloads\SDL2-devel-2.0.14-mingw\SDL2-2.0.14
-- Copy all file fromC:\Users\ADMIN\Downloads\SDL2-devel-2.0.14-mingw\SDL2-2.0.14\x86_64-w64-mingw32\bin
toC:\Windows\system32
andC:\Windows\sysWoW64
-
From CB Select
file->new->project...->SDL2.0
-
Enter project name and choose the path to SDL2 library eg.
C:\Users\ADMIN\Downloads\SDL2-devel-2.0.14-mingw\SDL2-2.0.14\x86_64-w64-mingw32\
-
Choose GNU/GCC compiler (this is selected by default, if not, please reinstall CB with MinGW64)
- From project name (with colored windows icon), right click to select
build options
- Click
search directory
- From
Compiler option
chooseAdd
, paste the path<path-to-sdl-2>\SDL2-2.0.14\x86_64-w64-mingw32\include\SDL2
and confirm - From
Linker option
chooseAdd
, paste the path<path-to-sdl-2>\SDL2-2.0.14\x86_64-w64-mingw32\lib
and confirm
- Build and Run the project