English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2006-09-26 03:15:44 · 2 answers · asked by karthik sripal 2 in Computers & Internet Programming & Design

2 answers

The pre-processor makes a copy of your source and expands it before compiling. Where you have includes (imported files), it will copy that source and paste it in the pre-processed code. Where you have defined things like constants it will replace them will literal values. So what you end up with is a more literal version of your code.

The job of the linker is to link together all your object files that the compiler creates from your sources as well as any precompiled library files you need, as invoked in your code, into a binary executable.

This should explain it:
http://www.cs.caltech.edu/courses/cs11/material/c/mike/misc/compiling_c.html

2006-09-26 03:39:22 · answer #1 · answered by dt01pqt_pt 2 · 0 0

Assuming we're talking about C or a C-type language here.

Compiling in C is a (conceptually) 3 step process.

1. preprocess/
2. compile
3. link

The preprocess runs through the source & expands macros etc.

The compile translates the resulting (still c) code to 'object' code. (i.e. machine language with un-resolved linkages where external calls have been made).

The linker then joins all the object files & resolves all the un-resolved linkages to create an executable (That's then placed inside an executable format file.e.g. ELF or XCOFF or similiar - a .exe if your'e windoze).

2006-09-26 10:24:37 · answer #2 · answered by Hamish M 2 · 0 0

fedest.com, questions and answers