GCC Common options

Source: Internet
Author: User

-O Output_filename
Determine the name of the executable file is output_filename. If this option is not given, GCC gives the default executable filename a.out.

-C
Compile only, do not link to executable file, the compiler only generates. o as the target file of the suffix by the input. C source file.

-G
To generate the symbolic information necessary for debugging tools (GDB), you must add this option if you want to debug a compiled program.

-O
To optimize the compilation of the program, link, using this option, the entire source code will be compiled, linked process optimization process, so that the resulting executable can improve the execution efficiency, but, the speed of the compilation, link is correspondingly slower.

-o2
Better than-o optimized compilation, link, of course, the entire compilation, link process will be slower.

-ldirname
Add the directory indicated by DirName to the list of program header file directories.

-ldirname
Add the directory indicated by dirname to the directory list of the library file.

-lname
When linking, load the function library with the name "Libname.a", which is located in the System preset directory or in the directory determined by the-l option.

-static
Static link library files.

-wall
Generate all warning messages.

-W
Does not generate any warning messages.

-dmacro
Defining MACRO macros is equivalent to using #define MACRO in your program.

Original address: http://www.cnblogs.com/mikelin/archive/2010/07/15/1777858.html

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.