LINUX study notes 6 -- use the GCC compiler

Source: Internet
Author: User
A) create. c File 1. note: Use // B) compile: gcc file name option to produce the target program file name c) run the generated File :. /the file name is still required. /d) compile option 1. & amp; ndash; o: specifies the name of the generated executable program. a) if not specified, the generated program is generated by default... a) create. c file
 
1. note //
 
B) compile: Target program file name generated by the gcc file name option
 
C) run the generated File:./The file name is still required ./
 
D) compilation options
 
1.-o: specifies the name of the generated executable program.
 
A) If this parameter is not specified, a. out is generated by default.
 
2.-c: only compile, not generate executable files
 
3. gcc-g: generate debugging tools for debugging.
 
4.-O: optimize the program
 
5.-O: perform deeper optimization and slow connection
 
6.-I (large I): added the header file directory for gcc searching.
 
7.-L: added the library file directory searched by gcc.
 
8.-l (small L): indicates that the math library is used,
 
9.-static: static link library file,
 
A) static connection: only when library files and programs are combined during compilation can an executable file be generated. one file shares one library file, which occupies a large space.
 
B) Dynamic Link: contains the library file at runtime. multiple files share the same library file. the default value is
 
10.-wal: generate all warning messages
 
11.-w: do not generate all warning messages
 
12.-D: define the macro, which is equivalent to the # define

From the column of Ainemo

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.