How to include header files from a location other than the Project Headers

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to include header files from a location other than the Project Headers

11,424 次查看
atalbajracharya
Contributor I

Hi,

I am trying to include header files from a location other than the "project headers" folder in the codewarrior development studio for micro controllers v10.4. I have tried adding the path to the folder containing my header files by going to project properties-> C/C++general ->Paths and Symbols ->Include tab->C source file. But, when I add my header files, I get a "unresolved inclusion" error. Could anyone help me out with this.Thanks in advance!

 

Regards,

Atal

标签 (1)
0 项奖励
回复
8 回复数

8,817 次查看
forastero
Contributor I

Hi atalbajracharya .

Right click in project in project view => properties.

Click includes tab .

Click add .

Write the directory with includes files . Example : ${ProjDirPath}/Sources .

INCLUDE.png

0 项奖励
回复

8,816 次查看
BlackNight
NXP Employee
NXP Employee

Hi Atal,

the compiler include paths are in C/C++ Build > Settings > ARM Ltd Windows GCC C Compiler > Directories (see screenshot attached).

Erich

0 项奖励
回复

8,816 次查看
atalbajracharya
Contributor I

Hi, Erich

There is no directories option in the project properties window in my IDE. I have attached a screenshot.

Capture.PNG.png

Regards,

Atal

0 项奖励
回复

8,816 次查看
BlackNight
NXP Employee
NXP Employee

Ah, I was (wrongly) assuming it is for ARM/Kinetis. For ColdFire it is under ColdFire Compiler > Input.

Erich

0 项奖励
回复

8,815 次查看
atalbajracharya
Contributor I

I tried adding the include path in ColdFire Compiler > Input as you suggested but still, I am still getting an "Unresolved Inclusion" error, when I try to include a header file from that path. I have attached a screenshot.

Atal

Capture1.PNG.png

0 项奖励
回复

8,816 次查看
BlackNight
NXP Employee
NXP Employee

How are you including the that header file?

With

#include "file.h"

or with

#include <file.h>

?

If you are using <...>, then add it to the 'System Path' directory list.

And: is the error produced by the compiler (present in the console view) or by Eclipse (just marked in the Editor view)?

If it is just in the Editor view, I think this was an issue with Eclipse (not with the compiler).

0 项奖励
回复

8,816 次查看
atalbajracharya
Contributor I

I am using the " " to add the header files.And, yes I am only getting the error in the editor, while the code compiles and runs Ok! Is,there a way to get around this issue with eclipse,because if I want to view my header files from the Eclipse I still won't be able to do so. 

Atal

0 项奖励
回复

8,816 次查看
BlackNight
NXP Employee
NXP Employee

There should be no issue at all viewing header files in Eclipse. But 10.4 is rather old, you might try out the 10.6 release. I have not verified it, but it could be that this issue is solved in that newer Eclipse version.

Erich

0 项奖励
回复