how can I write a library function in codewarrior v10.4

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

how can I write a library function in codewarrior v10.4

738 Views
guochunhua
Contributor II

Hi,excuse me,I have some problems need your help. they are as follows.

  1.how can I write a library function in codewarrior v10.4, can you give me an example program?

  2.how can I install the library function in my specified path,can you give me an example ?

  3.if I install the library function in my specified path, how can I call the function. can you give me an example?

Labels (1)
Tags (1)
0 Kudos
5 Replies

524 Views
BlackNight
NXP Employee
NXP Employee
0 Kudos

524 Views
guochunhua
Contributor II

Thank you for your help very much. I am sorry I want to know how to make and how to use a library function with MC56f84789 in codewarrior 10.4 ?

0 Kudos

524 Views
TICS_Fiona
NXP Employee
NXP Employee

Hello  guo

To generate the library file, please open Project Properties, and select the linker output type as 'Library', and rename the artifact extension as 'lib'. You also need to remove the link command file from the building.

Output Type.png

artifact extension.JPG

Best Regards

Fiona Kuang

Technical Information & Commercial Support

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

524 Views
guochunhua
Contributor II

Thank you for your help very much. if I put my library function in another path, which is not my application program's path, how can I call the library function in my application program? can you give me an example? if you can give me an example with mc56f84789 in codewarrior 10.4, it's the best.

0 Kudos

524 Views
TICS_Fiona
NXP Employee
NXP Employee

Hello guo

In your application project, please add your library in the Linker Input of the Project Properties, and in the C file which calls the library function, add the external function declaration for it.   Hope it helps!

lib.png

Best Regards

Fiona Kuang

Technical Information & Commercial Support

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos