Parameters for GCC compilation under Linux detailed description

Source: Internet
Author: User

Reference URL: 1 http://hi.baidu.com/zengzhaonong/item/f1f9383565fa5c302e0f8125 gcc Usage Summary

2 HTTP://S99F.BLOG.163.COM/BLOG/STATIC/35118365201311261453629/GCC parameter differences

3 http://blog.csdn.net/ruglcc/article/details/7814546 Makefile Tutorial

Just touch C programming under Linux. Prior to the project, contact the system hierarchy, but recently found that the C program is also, especially in the preparation of large projects, also divided into three layers: Control layer Interface Layer module layer.

Then, at compile time, you need to use makefile to compile. At this time again looked at GCC compilation and makefile. When you see other people's makefile, find out some details.

1 gcc -i -l-l-r-e-S -o-o-wall-c-m-g Detailed Description:-I (uppercase letter i) The specified directory as the first directory to look for a header file

-l Specifies the directory as the first directory to find the library file

-L (lowercase l) assigns the specified directory as the first directory to look for a dynamic-link library file

-E will. C file preprocessing for. I files

-S will. I file compiled into. S file

-O will. s file

-O to the program to optimize the compilation, link, with this option, the entire source code will be compiled, linked process optimization processing, so that the resulting executable file execution efficiency can be improved, but the speed of compiling, linking is correspondingly slower.

-wall Display all warning messages at compile time

-C compiles only, does not link to an executable file, and the compiler only generates. O is the suffix of the target file, usually used to compile a subroutine file that does not contain the main program.

-G generates symbolic information necessary for the Symbolic debugging tool (GNU GDB), and to debug the source code, we must add this option.

Parameters for GCC compilation under Linux detailed description

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.