gcc
来源:互联网 发布:windows程序设计百度云 编辑:程序博客网 时间:2024/04/27 16:55
Notice:
1、-v和--version的作用并不总是一致;
2、
(Display compiler version information)
$ gcc --version
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
(Display the programs invoked by the compiler编译器将会调用到的程序)
$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.4-14ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)
$ gcc --help
Usage: gcc [options] file...
Options:
-pass-exit-codes Exit with highest error code from a phase
--help Display this information
--target-help Display target specific command line options
--help={target|optimizers|warnings|params|[^]{joined|separate|undocumented}}[,...]
Display specific types of command line options
(Use '-v --help' to display command line options of sub-processes)
sub-processes的命令行选项
--version Display compiler version information
$ gcc --version
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-dumpspecs Display all of the built in spec strings
-dumpversion Display the version of the compiler
$ gcc -dumpversion
4.4.5
-dumpmachine Display the compiler's target processor
$ gcc -dumpmachine
x86_64-linux-gnu
-print-search-dirs Display the directories in the compiler's search path
$ gcc -print-search-dirs
install: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/
programs: =/usr/lib/gcc/x86_64-linux-gnu/4.4.5/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/libexec/gcc/x86_64-linux-gnu/4.4.5/:/usr/libexec/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../x86_64-linux-gnu/bin/x86_64-linux-gnu/4.4.5/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../x86_64-linux-gnu/bin/
libraries: =/usr/lib/gcc/x86_64-linux-gnu/4.4.5/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/4.4.5/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../x86_64-linux-gnu/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../x86_64-linux-gnu/4.4.5/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/:/lib/x86_64-linux-gnu/4.4.5/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/4.4.5/:/usr/lib/../lib/:/usr/lib/x86_64-linux-gnu/x86_64-linux-gnu/4.4.5/:/usr/lib/x86_64-linux-gnu/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../x86_64-linux-gnu/lib/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../:/lib/:/usr/lib/:/usr/lib/x86_64-linux-gnu/
-print-libgcc-file-name Display the name of the compiler's companion library
$ gcc -print-libgcc-file-name
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/libgcc.a
-print-file-name=<lib> Display the full path to library <lib>
显示lib的全路径
-print-prog-name=<prog> Display the full path to compiler component <prog>
显示编译器组件prog的全路径
-print-multi-directory Display the root directory for versions of libgcc
-print-multi-lib Display the mapping between command line options and multiple library search directories
-print-multi-os-directory Display the relative path to OS libraries
-print-sysroot Display the target libraries directory
-print-sysroot-headers-suffix Display the sysroot suffix used to find headers
-Wa,<options> Pass comma-separated <options> on to the assembler
给汇编器传递options
-Wp,<options> Pass comma-separated <options> on to the preprocessor
给预处理器传递options
-Wl,<options> Pass comma-separated <options> on to the linker
给链接器传递options
-Xassembler <arg> Pass <arg> on to the assembler
给汇编器传递参数
-Xpreprocessor <arg> Pass <arg> on to the preprocessor
给预处理器传递参数
-Xlinker <arg> Pass <arg> on to the linker
给链接器传递参数
-combine Pass multiple source files to compiler at once
-save-temps Do not delete intermediate files
-pipe Use pipes rather than intermediate files
-time Time the execution of each subprocess
记录每个subprocess的执行时间
-specs=<file> Override built-in specs with the contents of <file>
-std=<standard> Assume that the input sources are for <standard>
--sysroot=<directory> Use <directory> as the root directory for headers and libraries
-B <directory> Add <directory> to the compiler's search paths
为搜索路径添加目录
-b <machine> Run gcc for target <machine>, if installed
运行指定目标machine的gcc
-V <version> Run gcc version number <version>, if installed
运行指定version的gcc
-v Display the programs invoked by the compiler
-### Like -v but options quoted and commands not executed
-E Preprocess only; do not compile, assemble or link
预处理,不编译,不汇编,不链接
-S Compile only; do not assemble or link
编译,不汇编,不链接
-c Compile and assemble, but do not link
编译,汇编,不链接
-o <file> Place the output into <file>
指定生成的可执行文件的名字为file
-x <language> Specify the language of the following input files
Permissible languages include: c c++ assembler none, 'none' means revert to the default behavior of guessing the language based on the file's extension
Options starting with -g, -f, -m, -O, -W, or --param are automatically passed on to the various sub-processes invoked by gcc. In order to pass other options on to these processes the -W<letter> options must be used.
给subprocess传递参数
For bug reporting instructions, please see:
<file:///usr/share/doc/gcc-4.4/README.Bugs>.
- gcc/
- gcc
- gcc
- gcc
- GCC
- gcc
- GCC
- gcc
- gcc
- GCC
- gcc
- Gcc
- gcc
- gcc
- GCC
- gcc
- gcc
- gcc
- VC6控制台输出中文乱码
- 网络层相关概念
- C语言数据结构练习——停车场管理系统(使用栈和队列)(草稿的草稿)
- (网络层)路由协议
- (网络层)IP 协议首部格式与其配套使用的四个协议(ARP,RARP,ICMP,IGMP)
- gcc
- android禁止横竖屏切换
- Spring对JDBC的支持
- 动态规划算法 (微软笔试题,求连续子数组的最大和)
- struts2实例解析
- (传输层)UDP协议
- Linux学习笔记(十五)
- 人人开放平台
- Spring 传统JDBC编程替代方案