I'm migrating to from Windows to Linux and I heard a lot about Linux and how you can do some real good programming under Linux. But I'm have no idea about how to compile a code written in C on Linux.
Compile your source file
this will generate an executable named
To specify the name of the executable during compilation:
gcc is also the C++ compiler. There are plenty command line options available, so it's worth getting to know the man page.
Here is the manual for the most recent version of the compiler.
Find a tutorial on the Gnu Compiler Collection and read it all trying examples on an hello world program. Make obvious errors to get used to the error messages that it spits out and look them up. There is a wealth of knowledge online about different messages. You can copy and past them into google and find good results.
A good book would be (An Introduction to GCC) by Brian Gough :ISBN 0-9541617-9-3:
One thing you should always include in compiling is the -Wall flags(the W is in caps). It tells gcc to spit out the most common error messages.
geany is the text editor I uses as it is light weight fast and includes just about anything you could need in an IDE.
After you get used to gcc check out make as they go hand in hand for projects. What make does is provide a way to compile everything with out having to remember what libs need to be manually included for linked on compile time form the terminal. It also makes you life easier and easier as a project gets more complicated.