Sign in to follow this  
bikola_p

Linux Compiler

Recommended Posts

Hey guys, im looking for a linux compiler, im new to linux, all i know is that it basically needs to compile C code, and run from command line. Thanks.

Share this post


Link to post
Share on other sites
The GNU Compiler Collection consists of compilers for several languages. This includes a compiler for C. Your distro should include this packet. See http://gcc.gnu.org/ for details and downloads.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Try typing gcc in a command prompt. I bet you already have it installed.

Share this post


Link to post
Share on other sites
Yes gcc is installed on any linux desktop setup.
Just type gcc bla.c -o bla and execute with ./bla.
For more info type man gcc or info gcc on the command line.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Konfusius
Yes gcc is installed on any linux desktop setup.
Just type gcc bla.c -o bla and execute with ./bla.
For more info type man gcc or info gcc on the command line.


well, usually this is true-however various distributions feature meanwhile linux installations without setting up the "standard" stuff, so if you actually install a recent linux distro selecting a desktop/gaming/multimedia profile, you may indeed end up with an installation without GNU toolchain.

Share this post


Link to post
Share on other sites
Quote:
Original post by Konfusius
Yes gcc is installed on any linux desktop setup.

I think you mean "most" or "some". With the number of non-guru oriented distros around these days, you just might have to install it.

Quote:
Just type gcc bla.c -o bla and execute with ./bla.

I think you mean "foo", not "bla". foo > bla

Quote:
For more info type man gcc or info gcc on the command line.

I wouldn't point a newbie at the gigantic GCC manpage. Staring at hundreds of options for tens of architectures (some of which he's probably never even heard of), digging through some very technical terms, looking for that one option he needs is probably not what he wants to be doing.

This document should get you started. But as with all tutorials, it's just to get your foot in the door. You will have to delve into that man page, so be prepared, but this doc covers just about all the switches you'll need.

I also recommend learning GNU Make. When people start of learning to code on Linux, they often get stuck after a few source files. Make manages your project for you, and also cuts down signifigantly on build times.

Another vital tool you'll need to learn is an editor. I use Vim, it's extremely powerful and you can edit very quickly with it. Emacs is also popular, but as I understand it, they finally included the kitchen sink and it's now a 5 gigabyte install. Whichever editor you choose, make sure it's a powerful one. A simple one may be OK in the beginning, but you'll really want something more powerful later on. Remember, when coding, most of your time is spent in this editor! It should be comfortable, and allow you to edit files easily. Don't be afraid of the learning curve here, it's well worth the investment.

Um.. one last tool. Sorry, but it looks like you have a lot of learning to do :P This tool is SVN, the Subversion version control software. Version control is important! If you haven't been using it yet, you should be. Being able to roll back changes alone is a feature worth learning this for.

Hope this helps!

Share this post


Link to post
Share on other sites
Quote:
Original post by cyberninjaru
KDevelop is an excellent IDE compiler


a) It is not a compiler. It's an IDE.
b) It does not run from the command-line.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this