如何通过包含的makefile头文件 [英] How to include header file through makefile

查看:259
本文介绍了如何通过包含的makefile头文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有,可以在Makefile中用于包括在其中被编译的所有文件的头文件,就像是有-D标志,包括定义的标志。什么标志正是为了包括头文件是。我不记得认识。

I know that there is a flag that can be used in makefile to include a header file in all the files which are being compiled, just like there is a -D flag to include a define. What flag is exactly for including header files. I don't remember know.

推荐答案

在你的编译命令,你可以使用 -include 选项:

In your compile command, you can use the -include option:

gcc -o main -include hello.h main.cpp 

这篇关于如何通过包含的makefile头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆