C Language Learning note clang directive (ii)

Source: Internet
Author: User

1. Compile a single C source file and produce a target file
Cc-c one.c
This command produces a target file named ONE.O.

2. Compile multiple C source files and generate a target file for each file
Cc-c one.c two.c three.c
This command produces 3 target files: one.o, TWO.O, THREE.O

3. Link a single target file
CC ONE.O
This command produces an executable file named A.out.

4. Link multiple target files
CC ONE.O TWO.O THREE.O
This command produces an executable file named A.out.

5. Compile and link a C source file
CC ONE.C
This command produces an executable file named A.out. A target file named ONE.O is generated in the middle, but it is deleted when the link process is complete.

6. Compile and link multiple C source files
CC ONE.C TWO.C three.c
This command produces an executable file named A.out. When more than one source file is compiled, the destination file is not deleted. This allows you to make changes to the program and recompile only the source files that have been changed.

7. Compile a C source file and link it to the existing target file
CC ONE.O TWO.O three.c
This command produces an executable file named A.out.

8. The above can produce executable file instructions can be added to the "-O name" option, the resulting executable is called name
Like Cc-o ABC one.c.
This command produces an executable named ABC.

9. Execute executable file
./a.out
This instruction can execute a executable file named A.out.

Clang instruction for the

C language Learning Note (ii)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.