I got Linux and started again.

xiaoxiao2021-03-06  19

Today, Rad Hat 9.0, I feel very good, the interface is getting closer to the WIN style, it is very intimate, huh, huh. The first thing is of course configuring TCP / IP. It is very simple, and there is no difference in Windows, there is no extraordinary IP Addresss, Submask Address, Gateway Address, is very simple. You can do it online. What is the stuff, the buddy is online. LINUX The default compressed format is: tag, gz, zip, the tool with the system is extracted to decompress OK, but the online is more RAR format, so the urgency is of course the next decompression software. So I found a Linux version of Rar. There is only RAR (compressed files), unrar (unzip file) and other parts after installation. In directory of RAR, UNRAR, COPY to / USR / BIN, is to run compression and decompression commands directly under the shell. The only difference in Windows is compressed, unzipped is Command line, but don't be afraid, the command is helpful, and the cumbersome parameters are in front of the help!

Hey, think about what we need now? By the way, I got Linux, I can't do GCC, haha. Going to Down is OK! Now I know the benefits of Linux, and the FREE's Dongdong is :). It's just fine with Emacs, this IDE is really good, supporting a lot, you are so good. Waiting for these, Hello Linux is born! Ha ha. Code, simple, no need to waste the layout here. However, the parameters of GCC have a lot of parameters, so give everyone a good thing, put the GCC parameters, there is a reference when Down is going to use, remember the commonly used several. OK. Write so much first, the part below is made, the key! The essential! :)(to be continued)

Here is the GCC parameter [turn], put it together, you can check it yourself.

GCC parameter details

[Introduction] GCC and G is a GNU's C & C compiler

GCC / G requires 4 steps when performing compilation

1. Preprocessing, generates .i file 2. Files that the pre-processed file does not convert the pre-processed file into assembly language, generate files .s 3. There is a compiled change to target code (machine code) generation .o file 4. Connection target code Generate an executable program

[Parameter Detailed] -X Language FileName Set the language used by the file, makes the retrore name, which is valid for the future. That is, based on the suffix name of the convention C language, and C suffers are .c Or .cpp, if you are very personal, determine your C code file's suffix name is .pig haha, then you will use this parameter, this parameter works on his file name, unless the next parameter is used. . The parameters you can use have these `c ',` Objective-c', `c-header ',` C ', `cpp-output ',` assembler', and `assembler-with-cpp '. See English should be understood. Example usage: gcc-xc hello.pig -x none filename turned off the previous option, that is, let GCC automatically identify file type example usage: gcc -xc hello.pig -x none hello2.c -c only Activate pretreatment, compile, and compile, that is, he only makes the program into an OBJ file example: gcc -c hello.c He will generate .o Obj file -s only activation pre-processing and compile, means compiling files Become a assembly code. Example GCC -S Hello.c He will generate .S assembly code, you can use the text editor to see

-E only activates pre-processing, this does not generate files, you need to redirect it into an output file. Example usage: gcc -e hello.c> Pianoapan.txt gcc -e hello.c | more slowly, A Hello Word also wants to process the code to be 800 lines

-o Develop a target name, the default, the file compiled by the GCC is a.out, it is difficult to listen, if you have the same feeling, change it, haha ​​example gcc -o hello.exe hello.c (Oh, Windows uses habits) GCC -O Hello.asm -s hello.c -pipe uses pipes instead of compiling temporary files, when using non-GNU assembly tools, there may be some questions GCC -PIPE -O Hello.exe Hello.c

-ansi off the characteristics of the ANSI C in GNU C, activating ANSI C's proprietary characteristics (including some ASM Inline TypeOf keywords, and Unix, VAX and other pre-processing macros,

-fno-asm This option implements a part of the functionality of the ANSI option, which is forbidden to use ASM, Inline, and TypeOf as a keyword. -fno-strict-prototype works only to G , using this option, G will be a function that does not have parameters, it is considered that there is no explicit to the number and type description of the parameters, not without parameters. And GCC does not With this parameter, you will have a function without parameters. It is considered that the city has no explicitly instructions. -FThis-is-varialble is in line with traditional C , you can use this as a general variable. -Fcond-mismatch allows conditional expressions The second and third parameter types do not match, the value of the expression will be the four parameters of the VOID type -funsigned-car -fno-signed-char-fsigned-char -fno-unsigned-char, which is set to the char type, decided Set the char type to unsigned char (the first two parameters) or Signed char (the latter two parameters) -include file contains a code, simply, when you use a file, you can need another file. With it, the function is equivalent to using a #include example usage in your code: gcc hello.c -include /root/pianopan.h -imacros file will expand the macro of the File file to GCC / G input files Macro definition itself does not appear in -Dmacro equivalent to the #define macro -dmacro = defn in the C language in the input file, is equivalent to the #define macro = defn -umacro equivalent to the C language in C language.

-undef cancels the definition of any non-standard macro-IDIR when you use #include "file", GCC / G will first find the header file you make in the current directory. If you didn't find it, he returned to the default The header file directory is found, if you use -i to develop a directory, he will look up in the directory you have developed, then go to the regular order. For #include , GCC / G will go to the -i-set directory Find, find you can't find it, then find -i -i -i-I -IDIRAFTER DIR in -id after -idir after -idir after -idir after -idir, tells In this directory. -Iprefix prefix -iwithprefix Dir is generally used, when the -i directory lookup failed, find -nostdinc to find -nostdinc to find the compiler without the system default header file directory, general And -i use, clearly defining the position of the header file - NostDIN C specifies the searcher in the standard road specified by G , but still search in other paths, this option is in the time of the use of the libg library, when preprocessing, Do not delete the comment information, generally and -e use, sometimes analyze the program, with this very convenient -m generated file associated. All source code depends on the target file You can test it with gcc -m hello.c, very simple. -Mm and the above, but it will ignore the dependencies caused by #include . -Md and -m are the same, but the output will be the same as the file imported to .d and -mm, but the output will be imported into .d -Wa, Option This option passes the Option to the assembler; if there is Option Commodity, divide Option into multiple options, then pass to the assembler -wl.option This option passes the Option to the connection program; if there is a comma in the option, you divide the option into multiple options, then pass to the Connect. LLIBRARY uses the library preparation when compiled GCC -LCURS HELLO.C uses NCurses library compiler - LDIR to search the path. For example, your own library, you can use it to create a directory, otherwise the compiler will only look at the directory of the standard library. This DIR is the name of the directory. -O0 -O1 -O2 -O3 compiler's 4 levels, -O0 indicates that no optimization, -o1 is the default value, the -O3 optimization level is only the compiler, when compiled, the creation is information. -gstabs This option claims to debug information in a Stabs format, but does not include GDB debugging information. -gstabs This option is claimed to debug information in the Stabs format, and contains additional debugging information for GDB. Can use debug information.

转载请注明原文地址:https://www.9cbs.com/read-47760.html

New Post(0)