gcc -Iproj/src myfile.c -o myfile gcc -c myfile.c "compile without linking gcc -D DEBUG myfile.c -o myfile gcc -glevel "level=0,1,3,null "gcc -l links with a library file. "gcc -L looks in directory for library files. "Link -l with library name without the lib prefix and the .a or .so extensions gcc myfile.c -o myfile gcc -Wall "enable all warnings..
gcc
-I -L -l -D -g -O -o -Wall
about the -0 option.. ref to the following table..
Set the compiler‘s optimization level.
option | optimization level | execution time | code size | memory usage | compile time |
---|---|---|---|---|---|
-O0 | optimization for compilation time (default) | + | + | - | - |
-O1 or -O | optimization for code size and execution time | - | - | + | + |
-O2 | optimization more for code size and execution time | -- | + | ++ | |
-O3 | optimization more for code size and execution time | --- | + | +++ | |
-Os | optimization for code size | -- | ++ | ||
-Ofast | O3 with fast none accurate math calculations | --- | + | +++ |
+increase ++increase more +++increase even more -reduce --reduce more ---reduce even more
时间: 2024-10-10 06:27:28