Common gcc options

Source: Internet
Author: User
Common gcc options-general Linux technology-Linux programming and kernel information. See the following for details. For personal experience, please advise.

-C
※Preprocessing: only the object file is generated and the. o file is generated.

-O
※Generate the target file. If this option is not included, a. out is generated.

-Ansi
※Support For ansi C

-Include file
※Specify the include file name, which is equivalent to # include in the code.

-IDir
※Specify the path of the header file. If the header file is not in the default path of the system, use this option.

-I-
※Cancel-IDir. the compiler will not search for header files in the previous option.

-G
※Generate debugging information. Otherwise, gdb cannot perform debugging.

-Wall
※Generate warning information


-O <0-3>
※The upper-case letter O is not a number 0. The default optimization option is-O1.-O0 is not optimized, and the level is higher.
The longer the variation time.

-Static
※Without using the dynamic Connection Library, the dynamic library is generally directly integrated into the program to become part of the program,
Therefore, the generated code is relatively large.

-Share
※The dynamic library is used, so the code is relatively small. When the dynamic library file does not exist, the program cannot run.

-FPIC
※Independent code is generated, which is irrelevant to the path. It is generally used with-share.

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.