How to use SDL with gcc?
问题 I download SDL source at 'https://www.libsdl.org' I use cmake and get library. libSDL2.a libSDL2main.a libSDL2-2.0.so libSDL2-2.0.so.0 libSDL2-2.0.so.0.4.0 I write main.c to test SDL. #include <SDL.h> int main() { SDL_Init(SDL_INIT_VIDEO); SDL_Quit(); return 0; } I make lib directory. I move *.a file and include directory. vim main.c mkdir lib mv libSDL2.a libSDL2main.a ./lib mv /home/gakgu/다운로드/SDL2-2.0.4/include ./ Then try compile. gcc -W -Wall -o main main.c -Iinclude -Llib -lSDL2