The gcc compilation parameters in linux are described in detail.

Source: Internet
Author: User

The gcc compilation parameters in linux are described in detail.

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

2. Differences of gcc parameters for http://s99f.blog.163.com/blog/static/35118365201311261453629/

3 http://blog.csdn.net/ruglcc/article/details/7814546 makefile tutorial

I just got started with C Programming in linux. I used to work on a project, but recently I found that c Programs, especially when writing large projects, are also divided into three layers: control layer interface layer Module layer.

Then, during compilation, you need to use makefile for compilation. At this time, you can re-view the gcc compilation and Makefile. Some details are found when you refer to other people's Makefile.

1 gcc-I-L-l-r-E-S-o-O-Wall-c-m-g detailed description:-I (uppercase letter I) use the specified directory as the first directory to find the header file

-L use the specified directory as the first directory to find the library file

-L (lower case l) uses the specified directory as the first directory to search for dynamic link library files.

-E: pre-process the. c file as a. I file.

-S: Compile the. I file into a. s file.

-O: Convert the. s file

-O optimizes program compilation and linking. With this option, the entire source code is optimized during compilation and linking. This improves the execution efficiency of executable files, however, the compilation and link speed is correspondingly slower.

-Wall: displays all warning information during compilation.

-C is only compiled and does not link to an executable file. The compiler is only input. c and other source code file generation. o is a target file with a suffix. It is usually used to compile a subroutine file that does not contain the main program.

-G generate the symbolic information required by the GNU gdb tool. To debug the source code, we must add this option.

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.