- Built a cross-platform app that can be run on any kind of OS (MacOS, Linux, Windows, etc...)
- Use as a template for any project that utitlise SDL2.0
- g++ in Linux Ubuntu
sudo apt-get install g++
sudo apt-get install libsdl2-dev
- CMake (used to compile the entire file if using CMakeLists)
sudo apt-get install cmake
- SDL2 add-ons libraries (OPTIONAL, only installed if you want to work with those extended libraries)
sudo apt install libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev libsdl2-gfx-dev
- Please run in order:
mkdir build
cd build
cmake ..
make -j4
./sdl_demo
To run this project in VSCode with CMake extension enabled, you should configure CMake to use 'UNIX Makefiles' for generator by configuring in USER settings.json:
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"cmake.generator": "Unix Makefiles",
Hit F7 to build and F5 to run.
Please give us a Star if you find this helpful !