-std=<standard> 假设输入源用于<standard>。 --sysroot=<directory> 使用<standard>作为headers和libraries的根目录. -B <directory> 将 <directory> 添加到编译器的搜索路径. v 显示编译器调用的程序. -### 与 -v 类似,但引用的选项和命令不执行. -E 仅执行预处理(不要编译、汇编或链接). -S 只编译...
-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 fin...
-print-prog-name=<prog>:显示编译器组件<prog>的完整路径。 -print-multiarch:显示目标的规范化 GNU 三元组,用作库路径中的一个组件。 -print-multi-directory:显示 libgcc 版本的根目录。 -print-multi-lib:显示命令行选项和多个库搜索目录之间的映射。 -print-multi-os-directory:显示操作系统库的相对路径。
不会执行预处理、编译、汇编、连接,只会测试输入文件的语法是否正确 -std 指定C方言,如:-std=c99,gcc默认的方言是GNU C 多源文件的编译方法 如果有多个源文件,基本上有两种编译方法: [假设有两个源文件为test.c和testfun.c] 1. 多个文件一起编译 用法:#gcc testfun.c test.c -o test 作用:将testfun....
-std=<standard> :假设输入源为<standard>。 --sysroot=<directory> :使用<directory> 作为头文件和库的根目录。 -B <directory> :将<directory> 添加到编译器的搜索路径。
-std:指定所使用的C语言标准,如-std=c11。 -I:指定包含头文件的目录。 -L:指定链接库文件的目录。 -l:链接指定的库文件。 1.31 只生成目标文件:-c 这个选项告诉gcc只编译源文件,而不进行链接操作。它生成目标文件(通常是以.o为扩展名),可以在后续的链接阶段使用。
%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} %{f*} %{g*:%{%:debug-level-gt(0):%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*} %{undef} %{save-temps*:-fpch-preprocess} %(distro_defaults) ...
-std= 确定编译语言的标准,目前只在编译 C 和 C++ 时有效 -fno-asm 不将 "asm" "inline" "typeof" 作为关键字,可以用他们做变量名等. -funsigned-char 将"char"的数据类型设为"unsigned",即无符号. -fsigned-char 正好相反,将"char"设为"signed". ...
(see manual for options) 生成列表文件 -o outputfile Name the final output file 命名最终输出文件名 --depend dependfile Save 'make' source file dependencies 保留 'make' 源文件依赖 --errors errorsfile Put stderr diagnostics to errorsfile 把标准错误判断放入errorsfile -I dir[,dir] Add dirs to...
gcc -std=c99 -g -Wall -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -lgthread-2.0 -pthread -lglib-2.0 -o test.elf test.c 如果头文件安装到非默认路径的库很多,这样一个一个去指定,这明显性就有些不太合理了。我们遇到的问题,那都是别人已经见过的了,所以在Linux中,就有这么一个工具...