I am really new to GCC and I don’t know how to use it. I already have a copy of a pre-compiled gcc binaries I’ve downloaded from one of the mirror sites in the gcc website. Now, I don’t know where to go from here. Please give me some tips on how I can proceed.
I am sorry for the rather vague question..
What I want are tips on how to use GCC. I’ve programmed in C in the past using the TC compiler. Thanks!
I really appreciate all of your suggestions. Thanks again.. 🙂
Baby steps to start with.
Create the file you want to compile (
hi.c) in your favorite editor, like:Then from the command prompt, execute:
That will give you an executable you can then run.
Beyond that, it really depends on how much C (or C++ or other GCC language) you know. If you’re a beginner at C, rather than just the GCC toolchain, get yourself a good beginner’s book on the language and start reading. Most importantly, do the exercises, play with the code and so forth.
Based on your update that you’re comfortable with C itself (the Borland line), you’ll probably only be interested in the immediate GCC differences.
GCC is a command-line compiler. There are IDEs that use it but GCC itself is not an IDE. That means you’ll probably be doing command-line compilation.
The basic forms of this are:
Once you get sick of doing that, you’ll want to learn how to use make, a way of automating the build process with a file containing rules (dependencies and actions to take), such as:
I don’t do justice to the power of
makehere, it’s far more expressive than it looks.