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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

11,415 Views
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

Labels (1)
0 Kudos
Reply
8 Replies

8,808 Views
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 Kudos
Reply

8,807 Views
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 Kudos
Reply

8,807 Views
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 Kudos
Reply

8,807 Views
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 Kudos
Reply

8,806 Views
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 Kudos
Reply

8,807 Views
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 Kudos
Reply

8,807 Views
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 Kudos
Reply

8,807 Views
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 Kudos
Reply