I changed main to SDL_main but I don't see how it could be running as a console application because the console was coming up as well as the program but I suppressed it. It still changes size when I move the executable to a different folder - as if there is some dependency which is linked to the exe from the folder it is compiled in.
here is the code
it won't work on codepad.org because it doesn't have SDL.
You should include the libraries your program needs with it so that there aren't issues w/ version discrepancies. I had a huge problem with some of the optional SDL libs not being a part of the same release as the libSDL itself, involving SDL_mixer, SDL_net, and SDL_image. Never again!
~~You download them from~~ the libsdl.org website: http://www.libsdl.org/projects/SDL_ttf/ it looks like you might have to build the source yourself :P unless you can figure out who the "distribution maintainer" is (wtf? gatekeepers? seems a bit antithetical to Linux' philosophy IMO)
Dang, I never realized using SDL on Linux would be more complicated than other OS'. Well there are tutorials on lazyfoo.net for doing SDL stuff on Linux so maybe that will help.
Good luck!
Yeah, the website isn't the most intuitive with regards to the hosted projects. (Of course, you can chop the url down to [http://www.libsdl.org/projects/].
I would also suggest downloading (SDL2_gfx)[http://www.libsdl.org/projects/SDL_ttf/] as has graphics primitives functions, framerate management, image filtering, and other utility functions that can come in handy.
The archives are in tar.gz format. 7-Zip could extract these if you're on Windows:
If you're on a Mac, this should happen when you double click on the archive.
If all that fails, I could look into also including zip files.
I don't know which SDL game dev book you're referring to, but this one which I believe is the one you're referring to has exactly what you're looking for. Some of the later chapter have holes in the code, but you can download the missing code.