add common.h file KL05Z, Codewarrior10.6

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

add common.h file KL05Z, Codewarrior10.6

Jump to solution
2,718 Views
nguyennhatminh
Contributor IV

Hi Pro,

 

I try to create a project and I copy some source file from LED_LINK project.

 

But when I rebuild on other project , Codewarrior give me the message no such file or directory common.h

 

I added the common.h, but It seemS the compiler doesn't "see" the file.

10912_10912.pngERROR FOR COMMON.H FILE.png

 

please help me on this issue.

 

Thank you,

Nhat Minh

Labels (1)
0 Kudos
Reply
1 Solution
2,309 Views
trytohelp
NXP Employee
NXP Employee

Minh,

By default when you created a new project , the Project Header folder will list all header files defined for this project.

pastedImage_0.png

So if you want to add a new .h file the best way is to move it in the Project Header folder.

another solution is to add the path of this new header file.

this is the solution used for the library inside the compiler settings

pastedImage_1.png


Have a great day,
Pascal

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
10 Replies
2,309 Views
nguyennhatminh
Contributor IV

Thank you pascal,

I understand.

Minh

0 Kudos
Reply
2,309 Views
nguyennhatminh
Contributor IV

Hi Pascal,

Thank you very much for your support,

I wonder how to find the path definition of a file.

For example I have a main.c and i include some file such as "common.h" , "stdio.h"

so how do i find of the path definition of these file ? Codewarrior10.6

Thank you,

Minh.

0 Kudos
Reply
2,310 Views
trytohelp
NXP Employee
NXP Employee

Minh,

By default when you created a new project , the Project Header folder will list all header files defined for this project.

pastedImage_0.png

So if you want to add a new .h file the best way is to move it in the Project Header folder.

another solution is to add the path of this new header file.

this is the solution used for the library inside the compiler settings

pastedImage_1.png


Have a great day,
Pascal

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
2,309 Views
trytohelp
NXP Employee
NXP Employee

Hi,

Do you have checked in the LED_LINK project folders ?

Excepted the library files, all other sources files including header files used in a project example are provided in the project folder.

If you copy a source file, some header files must be copy too.

Can you check that ?


Have a great day,
Pascal

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
2,309 Views
nguyennhatminh
Contributor IV

HI Pascal

Thank you for your help,

When I copy the source header file from folder project.

I checked , my current project also have some header file.

But I wonder why the compiler doesn't "see" that header file.

I solved the issue by creating a new file header and then , copy the content of common.h from sample project then paste to the new one created. => It works fine. :smileyhappy:

Thanks,

Minh,

0 Kudos
Reply
2,309 Views
trytohelp
NXP Employee
NXP Employee

Hi Minh,

difficult to say why the header file was not found.

I'm pretty sure this was linked to a path definition.

In all case it seems you've solved the problem.

don't hesitate to contact us.

Have a great day,
Pascal

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
2,309 Views
santiago_lopez
NXP Employee
NXP Employee

Hi there,

I think the information in this post might help you:

Re: C file can't find local header file to include

Saludos :smileyhappy:

0 Kudos
Reply
2,309 Views
nguyennhatminh
Contributor IV

hi Santiago_Lopez

Thank you for your reply , I'm using codewarrior 10.6 and the Perspective doesn't like the instruction.

I also added the directory "header file" and the compiler detect the common.h but can't detect arm_cm0.h....

and I can't solve my problem.

But I wonder what happening ?

If you have experience on this case, please share with me ,

Thanks a lot,

Minh.

0 Kudos
Reply
2,309 Views
santiago_lopez
NXP Employee
NXP Employee

Hi Minh,

It seems like you are trying to port some code from other compiler (like IAR) to CodeWarrior. IAR includes some header files and libraries that other compilers don´t. In your case, I think you need the common.h only to refer to the module registers. In this case, I would recommend you to replace the common.h with derivative.h (which is the CodeWarrior common header) this will refer you to the processor header file and will include all the register definitions.

The other option is look for the header files you are missing in the original project you are trying to port and add them to the CW project.

Saludos

0 Kudos
Reply
2,309 Views
nguyennhatminh
Contributor IV

Hi Santiago

Thank you very much for your reply.

As you know the common.h define things such as unit8 or unit32_t etc...

I solved the issue by creating a new file header and then , copy the content of common.h from sample project then paste to the new one created. => It works fine. :smileyhappy:.

Thanks,

Minh,

0 Kudos
Reply