How to use the GCC command commonly used in Linux

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

usegcccommandcommonlyused

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 :

-o

Specifies the generated output file

-E

Just perform compilation preprocessing

-S

take C Code to assembly code

-wall

Display warning message

-c

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. https://en.javamana.com/2022/175/20210729143829136I.html