Using SDL2 on linux with g++?

// Bad:g++ -o test.cpp a.out -lSDL2

// Good: g++ test.cpp -lSDL2 (a.out implicit)

// Better: g++ test.cpp -g -pedantic -o test -lSDL2

I suspect the main problem might simply have been putting the g++ arguments in the wrong order.


like Tietbohl said

SDL_QUIT is part of the enum SDL_EventType http://wiki.libsdl.org/SDL_EventType

you should use SDL_Quit(); http://wiki.libsdl.org/SDL_Quit


The header must be: <SDL2/SDL.h>
The quit function: SDL_Quit();
The command: g++ teste.cpp -o filename -lSDL2