描述makefile中的头文件位置 [英] Describing header file locations in makefile
本文介绍了描述makefile中的头文件位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在一个新项目中,我正在开发我有以下dir结构:
In a new project I am working on I have the following dir structure:
Project_base
|---- src
|---- bin
|---- h
| Makefile
在我的源文件中,我包括了这样:
And in my source files I have includes that look like so:
#include "../h/SomeHeaderFile.h"
而不是更正确的形式:
#include "SomeHeaderFile.h"
我需要添加到我的makefile,以便我可以删除相对路径包括所以他们会看起来正常吗?
ADDITION:此外,我在CDT(eclipse的C ++)中设置此项,以便在设计时也反映出来?
What do I need to add to my makefile so that I can removed the relative path includes so they will look normal?
ADDITION: also, where do I set this in CDT (C++ for eclipse) so that in design time this is reflected as well?
推荐答案
您需要在传递的参数列表中添加 -I ../ h
到gcc。
You need to add -I../h
in the list of parameters you pass to gcc.
这篇关于描述makefile中的头文件位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文