What is compiling: Translating the C source program into 0 and 1 that the computer can recognize;
What compiler to use: Xcode3 using GCC,XCODE4 with LLVM compiler (front end with clang)
How do I compile a program using the Clang compiler?
1. In the terminal, enter: Cc–c file name. C
2. Compile successfully, generate. O Target file
If the code has a syntax problem, the compiler will direct an error. and indicate the number of errors and the exact line number.
As long as there are 1 errors, the program will not compile successfully and will not generate an. o file
Warning messages are just some of the compiler's recommendations and do not affect compilation through
Link:
What the link does: combine the. o file and the C-language function library to generate the executable file
done by the linker, the Clang compiler already contains the link directive:
1. In the terminal, enter: CC file name. O
2. Link succeeds, generates a.out executable file
Run:
Directly double-click Open a.out File
Use the./a.out directive in the terminal
Compile together, Link: cc xxx.c
Run the process:
Summary clang directive
1. Compilation: Cc–c xxx.c
2. Link: cc XXX.O
3. Compile, Link: cc xxx.c
4. Run the executable file:./a.out
C-Compile, link, run