Learn GCC compilers

Source: Internet
Author: User

Compiling a simple source code

VI hello.c

#include <stdio.h>


int main ()

{

printf ("Hello Linux c,i ' m here. Waiting for your congratulations. ");

return 0;

}


Use the "-o" option to indicate the compiled file name.

GCC Hello.c-o Hello


GCC Common options

Options Description
-C Compiles only, does not link to an executable file, and generates only "-O" files. Often used to compile subroutine files that do not contain the main program.
-O Make the name of the output file
-G The symbolic information necessary to produce the symbolic debugging tool (GNU GDB).
-O
The compilation and linking process is optimized for processing.
-o2
Better process optimization. (Of course the speed will be slower)





This article from "Little Cui's experimental notes" blog, declined to reprint!

Learning the GCC compiler

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.