In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Linux system Gcc command refers to what, I believe that many inexperienced people are helpless about this, this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
Gcc (GNU C Compiler) is a powerful multi-platform compiler launched by GNU. It is one of the representative works of GNU.
GNU C Compiler (GNU C Compiler) is a powerful multi-platform compiler launched by GNU. It is one of the representative works of GNU.
gcc is a supercompiler that compiles executable programs on a variety of hardware platforms, with an average efficiency of 20%-30% higher than that of ordinary compilers.
The Gcc compiler compiles and links C, C++ source programs, assembly routines, and object programs into executable files. If no executable file name is given, gcc will generate a file named a.out.
In Linux, executable files have no uniform suffix, and the system distinguishes executable files from non-executable files by file attributes.
Linux system Gcc common command detailed explanation: gcc command under the meaning of the options-E: only for preprocessing, not compilation, assembly and linking
-S: Compile to assembly language only, no assembly and linking
-c: Compile, assemble to object code (i.e. binary that the computer can recognize)
-o: name of file after executing command
-g: Generate debug information
-w: No warnings generated
-Wall: Generate all warnings
gcc compilation four steps preprocessing: gcc -E Test.c -o Test.i
Compile: gcc -S Test.i -o Test.s
Compilation: gcc -c Test.s -o Test.o
Link to generate executable file: gcc Test. o-o Test
Simple program compilation process 1. First create a Test.c file
2. progressive compilation
① Pretreatment:
At this point we found that the Test.i file we created has appeared in the directory, so cat go in and see what's inside:
From this we found that: gcc-E option, can make the compiler stop after preprocessing, and output the results of preprocessing.
In this program, the result of preprocessing is to insert the contents of the stdio.h file into Test.c.
② Compilation:
The-S option of gcc means that our code is compiled into assembly language during program compilation.
③ Compilation:
The-c option of gcc indicates that the assembler is responsible for compiling the.s file into a target file, that is, a sequence that the computer can recognize.
④ Link generation executable file:
Connect the Test.o file and C standard input and output library, and finally generate the executable file of the program Test.
3. run the program
Here we complete the process from the initial code to the final executable file.
Linux versions are: Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and other versions. Deepin is one of the best Linux distributions in China; Ubuntu Kylin is a derivative distribution based on Ubuntu;Manjaro is a Linux distribution based on Arch;LinuxMint's default Cinnamon desktop is similar to Windows XP and easy to use;Ubuntu is a Linux operating system based on desktop applications.
After reading the above, do you know what the Linux Gcc command means? If you still want to learn more skills or want to know more related content, welcome to pay attention to the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.