????1. ????gcc??
????gcc???????GNU Compiler Collection??????????????????????????????????gcc?????C????????????GNU C Compiler???????????c??????????C++??java??Pascal???????gcc?????????????
????2. gcc?????
????gcc????????????????????????????????????ARM??X86????
????gcc????????????????????????????????????ν??????????????????????????????????????????????С???gcc??????????????????????????????С????????????????x86??????????arm?????С?
????gcc?ж????????????????????????????
????gcc?????黯?????????????????????CPU?????????
????gcc????????????κ???????????????????????
????3. gcc???????????
????gcc??????????????????????
??????????Pre-Processing??
???????? ??Compiling??
??????? ??Assembling??
???????? ??Linking??

??????????????????????????????????????Σ?gcc???ò??????????????????c????????????ccl??gcc?????????????????????????????е??ò????????????Σ?gcc???????????л?????????????????????????????????????????????????????????????λ??????????????????????????????????????е?????0??????????????????????????????????????????????????????0?????????????д?????????????????????????????????λ?????????????????????λ??????????????????????????????????????????????????仯????????????Щ????й??
????????GCC???????????衣
????4. gcc???????
???????????gcc???????

??????????????????hello.c?????????Щgcc??????????
????gcc -E hello.c -o hello.i   ??hello.c???????????????????hello.i ???
????gcc -S hello.i -o hello.s    ?????????????б??????????????
????gcc -c hello.s -o hello.o  ??????????б???????????????
????gcc hello.o -o hello ????????????????????????????
????gcc hello.c -o hello ?????????????????????
????gcc -c hello.c ?? gcc -c hello.c -o hello.o ????????????λ??????
???????gcc????????-Wall??????????????????????-Wall????????????????κδ?????棬????????????????????
????//bad.c
????#include<stdio.h>
????int main()
????{
????printf("the number is %f "??5);  //?????????the number is 0.000000?????????
????return 0;
????}
???????-Wall???
????gcc -Wall bad.c -o bad
????gcc??????????????
????warning: format ‘%f’ expects argument of type ‘double’?? but argument 2 has type ‘int’ [-Wformat=]
????printf("the number is %f "??5);
????5. gcc?????????
???????????????????????hello.c hello.h main.c ??????????????????£?
// hello.c
#include<stdio.h>
#include"hello.h"
void printHello()
{
printf("hello world! ");
}
//main.c
#include<stdio.h>
#include"hello.h"
int main()
{
printHello();
return 0;
}
//hello.h
//??????????????
#ifndef _HELLO_
#define _HELLO_
void printHello();
#endif
?????????????????????????α???
????gcc hello.c main.c -o main ???????????main
????????????????
????gcc -Wall -c main.c -o main.o
????gcc -Wall -c hello.c -o hello.o
????gcc -Wall main.o hello.o -o main
?????????????????????????????鷢????????????????????У????????±?????????????????????????????