I'm using Code::Blocks with MinGW
Settings -> Compiler -> Search Directories -> Compiler -> Added:
D:\InstalledPrograms\CodeBlocks\SimpleDirectMediaL ayer\SDL2-2.0.0\x86_64-w64-mingw32\include
Settings -> Compiler -> Search Directories -> Linker -> Added:
D:\InstalledPrograms\CodeBlocks\SimpleDirectMediaL ayer\SDL2-2.0.0\x86_64-w64-mingw32\lib
Settings -> Compiler -> Linker Settings -> Other Linker Options -> Added: -lmingw32 -lSDLmain -lSDL
The code of the main.cpp file:
I've too included the SDL2.dll file in the folder of the projectCode:#include <iostream> #include "SDL/SDL.h" using namespace std; int main(int argc, char* argv[]) { return 0; }