1. mkdir include: 创建一个名为include的文件夹。

  2. mv print.h include/: 将print.h文件移动到include文件夹中。

  3. gcc -o hello2 -Iinclude hello.c print.c: 使用gcc编译器编译hello.c和print.c两个源代码文件,并将生成的可执行文件命名为hello2。其中,-Iinclude选项告诉编译器在include文件夹中查找头文件。

解释mkdir includemv printh includegcc -o hello2 -Iinclude helloc printc

原文地址: https://www.cveoy.top/t/topic/eAQu 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录