구글와이드(336x280)_상단 2개


Compiling C/C++/C#

C Programming/Compiling
Having covered the basic concepts of C programming, we can now briefly discuss the process of compilation.
Compilation is basically translation -- a computer program called the compiler takes our C source code and translates it into the binary language used by computers. It is more complicated than that, but that is the basic idea.
To those new to programming, this seems fairly simple. A naive compiler might read in every source file, translate everything into machine code, and write out an executable. This could work, but has two serious problems. First, for a large project, the computer may not have enough memory to read all of the source code at once. Second, if you make a change to a single source file, you would rather not have to recompile the entire application. To deal with these problems, compilers break their job down into steps; for each source file (each .c file), the compiler reads the file, reads the files it #includes, and translates it to machine code. The result of this is an "object file" (.o). Once every object file is made, a "linker" collects all of the object files and writes the actual program. This way, if you change one source file, only that file needs to be recompiled and then the application needs to be re-linked.
Without going into the painful details, it can be beneficial to have a superficial understanding of the compilation process. In brief, here it is:

[edit] Preprocessor

In this stage, the "preprocessor directives" are processed. Essentially the preprocessor scans the source code and performs simple substitution of tokenized strings for others according to predefined rules. for example the line :
#include <stdio.h>  
in a program would be substituted for the actual source code in the file stdio.h. Other directives include #pragma compiler settings and macros. The result of the preprocessing stage is a text string.

[edit] Syntax Checking

This step ensures that the code is valid and will sequence into an executable program.

[edit] Object Code

The compiler produces a machine code equivalent of the source code that can then be linked into the final program. This step ensures that the code is valid and will sequence into an executable program.

[edit] Linking

Linking combines the separate object codes into one complete program by integrating libraries and the code into the final executable format. Linking is performed by a linker, which is often part of a compiler.

null



바보들의 영문법 카페(클릭!!)

오늘의 메모....

시사평론-정론직필 다음 카페
http://cafe.daum.net/sisa-1

바보들의 영문법 다음 카페
http://cafe.daum.net/babo-edu/

티스토리 내 블로그
http://earthly.tistory.com/

내 블로그에 있는 모든 글들과 자료에 대한 펌과 링크는 무제한 허용됩니다.
(단, 내 블로그에 덧글쓰기가 차단된 자들에게는 펌, 트랙백, 핑백 등이 일체 허용되지 않음.)

그리고 내 블로그 최근글 목록을 제목별로 보시려면....
바로 아래에 있는 이전글 목록의 최근달을 클릭하시면 됩니다.
그러면 제목을 보고 편하게 글을 골라 보실 수 있습니다.

그리고 내 블로그내 글을 검색하시려면 아래 검색버튼을 이용하시면 됩니다.


가가챗창

flag_Visitors

free counters