In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces you what the GCC parameters are, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Gcc and Gmail + are gnu's cached compiler gcc/g++, which requires a total of 4 steps to perform the compilation work:
1. Preprocess to generate .i file [preprocessor cpp]
2. Convert the preprocessed file into assembly language to generate the file .s [compiler egcs]
3. There is a file whose assembly is changed into object code (machine code) to generate .o [assembler as]
4. Connect the object code to generate an executable program [linker ld]
Detailed explanation of parameters
-xlanguagefilename
Sets the language used by the file so that the suffix name is invalid and is valid for more than one later. That is, according to the convention, the suffix name of the C language is .c, and the suffix name of C++ is .C or .cpp, if you are very individual, decide that the suffix name of your C code file is .room, then you should use this parameter, which works on the following file name, unless to the use of the next parameter. Are there any parameters that can be used? are there any parameters that can be used as follows: 'cantilevers, grammar, camera, etc.', and 'assembler-with-cpp'.
If you see English, you should be able to understand.
Xnonefilename
Turn off the previous option, that is, let gcc automatically identify the file type based on the file name suffix.
C
Only preprocessing, compilation, and assembly are activated, that is, he only turns the program into obj files
S
Only activate preprocessing and compilation, which means compiling the file into assembly code.
E
Only activate preprocessing, this does not generate a file, you need to redirect it to an output file.
O
Set the target name, by default, the file compiled by gcc is a.out, which sounds terrible, if you agree with me, change it.
Pipe
Using pipes instead of temporary files in compilation may have some problems when using non-gnu assembly tools.
GCC can be used to compile both C programs and C++ programs. Generally speaking, the C compiler determines whether it is a C program or a C++ program by the suffix name of the source file. In Linux, the C source file has the suffix .c, while the C++ source file has the suffix .C or .cpp. However, the gcc command can only compile C++ source files, not automatically connect to the libraries used by C++ programs. Therefore, the C++ + command is usually used to complete the compilation and connection of the C++ program, and the program will automatically call gcc to achieve compilation.
About what the GCC parameters are shared here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.