You are on page 1of 2

Stanard c ANSI C/C89

Also New releases C99 & C11

Compilers
Microsoft’s Visual C++ Compiler (included in Visual Studio)

Other Compilers are focused towards UNIX operating systems and not ideally suited to windows
development

Visual C++ compiler can be executed by the

cl command

GCC (GNU Compiler Collection)

Used in UNIX based operating systems

GCC is not designed to run on Windows and only does so with some help.

Fortunately, a developer on the Visual C++ Team at Microsoft has kindly provided a very simple
distribution

GCC is a collection of compiler

We can invoke the GCC compiler using the gcc command.

There is no official distribution of GCC compiler, every individual and organization has their own
distributions.

From source files to programs


Order of programs

Source files (*.c, *.cpp, *.h) ->Pre-processor ->(*.i)-> Compiler-> (*.obj) -> Linker-> (app.exe)

That code we write lives in text files called source files.

The files usually have two possible extensions,

.C for the actual source code and

.H for the declarations you might like to share among source files. Names of things in C need to be
declared before they can be used, so it's common to declare the common things that may be used by
different parts of a program in the header file.

The compiler itself compiles one file at a time. It doesn't include anything. It expects the preprocessor to
do that.
The source code in the main source file has been compiled and the results of the compilation are stored
in an object file, an intermediate representation ready for the linker.

We can't run object files. We need them to be linked together to form an executable.

~1

You might also like