I recently moved to linux and i\'m having an issue with compiling SDL C programs using gcc.
The command i\'m using:
gcc `sdl-config --cflags --libs`
None of the "popular" answers for this question are correct or working. Some of them have nothing to even do with the question being asked. I have the same problem.
SDL docs give an example for compiling like this: gcc -o main main.c `sdl2-config --cflags --libs`
Yet user is suggesting that it is order of arguments causing the problem!! It is not! In fact, their suggested order is something I have never seen before and is certainly not any kind of standard. SDL answers on this site are very low quality!
Update: I found a solution for some missing functions. SDL_SetVideoMode does not exist in SDL2. Use SDL_CreateWindow.