I use codeblocks. I would recommend you the same. Maybe you need to install build-essentials to compile programs.
sudo apt-get install build-essential
Answer from neo1691 on askubuntu.comVideos
I recently switched to ubuntu hence a total beginner. I wanted to install c compiler but same error keeps popping again and again. Pls help. Also I have little knowledge about linux so pls refrain from using strong phrases.
I use codeblocks. I would recommend you the same. Maybe you need to install build-essentials to compile programs.
sudo apt-get install build-essential
You need a text editor and a compiler
Use gcc as compiler and gedit as the texteditor, If you prefer an Integrated Development Environment try codeblocks or eclipse with cdt
In most Linux distributions, there are prepared packages available with the SDL libraries. On Debian and Ubuntu, you can simply sudo apt-get install libsdl-image1.2-dev. In Red Hat, Fedora, and CentOS, you can do sudo yum install SDL_image-devel.
You can get the correct flags for the compiler using sdl-config. The configure script is the “automated” tool for discovering the correct flags, but it is pretty compilicated. If you haven't used C libraries before, it isn't terribly obvious. The -I flag adds a directory to the search path for #include directives. The -L flag adds a directory to the search path for libraries and -l tries to add a library to the program. Compiling C happens in two steps, compiling and linking. Compiling only looks at header files (.h files) and only cares about -I directives; it output object code (.o files). Linking only cares about -L and -l options and attempts to resolve the symbols in the object code. Typically, libraries live in /lib and /usr/lib and headers live in /usr/include. However, headers are often broken out into separate subdirectories and thus require more specific -I directives. Some programs started to include foo-config programs that included the proper directives to compile against the library. pkg-config is a generic version used by many libraries, especially ones related to GNOME.
This is all very different from other languages which typically a) just use sources for libraries (e.g., PERL, Python) or b) have an executable format that contains all the information needed for compilation (e.g., Java, C#).
sdl-config would be present as the result of installing libsdl, which you must do before you install libsdl-image.
Why don't you install the packages provided with your distribution?