1.建立一个common文件夹
$ mkdir /common
2.在common文件夹下创建head.h
$ vim /common/head.h
#ifndef __HEAD_H__ #define __HEAD_H__ #include#include #include #include #include #endif
3.将head.h软连接到当前文件夹下
$ ln -s /common ./
4.在当前所有文件夹下的源文件,只需要包含include"head.h"
编译时执行命令:$ gcc xxx.c -I common



