How to generate obj files after compiling C language code for Linux

Source: Internet
Author: User
If you do not specify what file to compile, gcc default one step, directly generate the executable file
You can try some of the following parameters

-C

Only activates preprocessing, compilation, and assembly, that is, he only makes the program obj file

Example usage:

Gcc-c hello.c

He will generate the. O obj file

-S

Only pre-processing and compilation are activated, which means compiling the files into assembly code.

Example usage

Gcc-s hello.c

He will generate the assembly code for. S, which you can view with a text editor

-E

Just activate the preprocessing, this does not generate the file, you need to redirect it to an output file inside.

Example usage:

GCC-E hello.c > Pianoapan.txt

GCC-E hello.c | More

-O

Specify the target name, by default, the GCC compiled file is a.out,

Example usage



Gcc-o hello.asm-s hello.c

How to generate obj files after compiling C language code for Linux

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.