C 语言编译:使用 mkdir、mv 和 gcc 构建项目
-
mkdir include: 创建一个名为 'include' 的文件夹。
-
mv print.h include/: 将 'print.h' 文件移动到 'include' 文件夹中。
-
gcc -o hello2 -Iinclude hello.c print.c: 使用 gcc 编译器编译 'hello.c' 和 'print.c' 两个源代码文件,并将生成的可执行文件命名为 'hello2'。其中,'-Iinclude' 选项告诉编译器在 'include' 文件夹中查找头文件。
原文地址: https://www.cveoy.top/t/topic/gO2j 著作权归作者所有。请勿转载和采集!