c - gcc 命令中的 .o 文件是什么?
问题描述
gcc -o file1 file1.o file2.o file3.o
我对 C 没有太多经验,并且Makefile
在我们的系统中找到了上述内容。
在这种情况下,什么是.o
文件,什么是 file1.o?有关系file1
吗?
解决方案
-o file
Place output in file file
. This applies regardless to whatever sort of output is being produced, whether it be an executable file, an object file, an assembler file or preprocessed C code.
Since only one output file can be specified, it does not make sense to use '-o' when compiling more than one input file, unless you are producing an executable file as output.
Here executable file produced is file1
If '-o' is not specified, the default is to put an executable file in a.out, the object file for source.suffix in source.o, its assembler file in source.s, and all preprocessed C source on standard output.
.o files are compiled object file of your c code file.
Qouted here -> GCC Command-Line Options
推荐阅读
- python-3.x - Python 3 和 Selenium - 如何组合多个 For 循环 - 抓取 Web 表
- sql - 指定非空值时是否真的需要包含“is”,例如 SQLite 中的“IS NOT NULL”与“NOT NULL”
- python - 仅当前缀不存在时,如何向列表项添加前缀?
- node.js - NodeJS:请求库 - 使用 userQueryString 的正确方法是什么?
- python - 无法绘制 MAPE 和 MSE 的训练和测试值?
- java - 更新 UI 线程在 android 中无法正常工作
- c - 使用 azure-iot-sdk-c SDK 在 Azure IoT Edge 模块中实现直接模块方法的问题
- quota - 如何遍历组织中的所有 google cloud kms 密钥而不会遇到读取配额?
- android - 如何使用 ArrayAdapter 在 ArrayList 中的 ListView 中显示项目(图像的路径)?
- javascript - 如何在元素中向下滚动时向上扩展元素?