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,425件の閲覧回数
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,818件の閲覧回数
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,817件の閲覧回数
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,817件の閲覧回数
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,817件の閲覧回数
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,816件の閲覧回数
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,817件の閲覧回数
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,817件の閲覧回数
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,817件の閲覧回数
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 件の賞賛
返信