How to use the GCC command commonly used in Linux

User 4988085 2022-06-24 05:59:18 阅读数:495


Linux Common commands gcc Command to use GNU Derived from C/C++ The compiler , It is the most widely used compiler in the field of open source code , It has powerful functions , Support code optimization and other features , Let's share Linux Common commands gcc How to use the command .

Grammar format

gcc [ Parameters ] [ Source file ]

Common parameters :


Specifies the generated output file


Just perform compilation preprocessing


take C Code to assembly code


Display warning message


Only compile operations , No connection operation

Reference examples

Compile file without options :

 [[email protected]~]# gcc xxx.c

take xxx.c Preprocessing 、 assembly 、 Compile and link to form an executable xxx:

 [[email protected]~]# gcc xxx.c -o xxx

take xxx.c Preprocessing output xxx.i file :

 [[email protected]~]# gcc -E xxx.c -o xxx.i

take linux265.c and linux265_1.c Compile and link to linux265_2 Executable file :

 [[email protected]~]# gcc xxx.c xxx.c -o xxx

take linux265.c Preprocessing output linux265.i file :

 [[email protected]~]# gcc -E xxx.c -o xxx.i

So far about Linux Common commands gcc End of command sharing , If you are right gcc There are still questions about the use of the command. You can submit the questions to us through the comment area .

copyright:author[User 4988085],Please bring the original link to reprint, thank you.