Saturday, May 5, 2007

What is a compiler?

A compiler is necessary to make your source code (..c, .cpp, or .cc files) into a running program. If you're just starting out, you'll need to make sure that you have one before you start programming. There are many compilers available on the internet and sold commercially in stores or online. If you have Mac OS X, Linux, or other *nix variant (such as Unix or FreeBSD), you likely have a compiler such as gcc or g++ installed already.
Compiler terminology
Compile Colloquially, to convert a source code file into an executable, but strictly speaking, compilation is an intermediate step
Link The act of taking compiled code and turning it into an executable
Build A build refers to the process of creating the end executable (what is often colloquially refered to as compilation). Tools exits to help reduce the complexity of the build process--makefiles, for instance.
Compiler Generally, compiler refers to both a compiler and a "linker"
Linker The program that generates the executable by linking
IDE Integrated Development Environment, a combination of a text editor and a compiler, such that you can compile and run your programs directly within the IDE. IDEs usually have facilities to help you quickly jump to compiler errors.
Understanding the Compilation Process
The compilation and linking process A brief description of exactly what happens when you compile a program, covering the above terms in more detail
Dealing with Compilation Errors Some suggestions for hunting down compiler and linker errors in your code
Understanding Compiler Warnings Learn what compiler warnings mean and the hows and whys of fixing them
What compilers are available?
Borland Find out how to download and set up Borland's free command-line compiler
DJGPP Read about DJGPP, a DOS-based compiler
Dev-C++ and Digital Mars Read about Dev-C++, a good windows based compiler, and Digital Mars
Windows Only
Microsoft Visual C++ Read about Visual C++
g++ is a C++ compiler that comes with most *nix distributions.
gcc is a C compiler that comes with most *nix distributions.
Apple's own Macintosh Programmer's Workshop is a compiler I've never used, but it is direct from apple and free.
Codewarrior My experiences with Codewarrior are limited to Java programming, though it's gotten good reviews in the past. It's a full IDE rather than just a compiler, meaning that it has a text editor and debugger integrated with the compiler so you can do all your work from one place.

No comments: