How to build a library in Code Warrior 5.0

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

How to build a library in Code Warrior 5.0

Jump to solution
2,338 Views
tranvkhoa
Contributor I
Hello
 
I'm using Code Warrior 5.0 for developing CAN driver for HC08GZ60, now I want to build this driver into a library (lib file) in order to use in another CAN application. Could you please tell me how to do this? I cannot find the option to do this in CW.
 
Thanks,
Khoa Tran 
Labels (1)
Tags (1)
0 Kudos
1 Solution
476 Views
BlackNight
NXP Employee
NXP Employee
Hello,
Go to the project settings/preference panel and in Target > Target Settings > Linker set the linker to "Libmaker for ...." and it will create a library for you.

Erich

View solution in original post

0 Kudos
3 Replies
477 Views
BlackNight
NXP Employee
NXP Employee
Hello,
Go to the project settings/preference panel and in Target > Target Settings > Linker set the linker to "Libmaker for ...." and it will create a library for you.

Erich
0 Kudos
476 Views
tranvkhoa
Contributor I
Dear Erich
 
Thanks for your quick answer. I can make a library now.
I have another question, when using this library (lib file) in the new project, do I need any other dependencies such as the header files, etc?
 
Thanks,
Khoa
0 Kudos
476 Views
BlackNight
NXP Employee
NXP Employee
Hi Khoa,
you have two choices:
- add the .lib file to the project (like a 'true' library): then it is simply using that .lib file and linking it to your elf file/application file. If you do changes in the files creating the library or in your library project, the library will not be re-built. That's useful in case you want to keep the library 'stable'.
- the other thing is you want to rebuild the library whenver something for the library changes. For this add the .mcp (project file) to your application project. Then the build system will check/build the 'subproject' and rebuild the library if needed. If you want to do this, make sure that you go to the 'Targets' Tab of your project and enable the dot under the 'link chain' column: with this the output file of your sub project (the library) will be added to your 'master project'.

This sounds maybe a little bit complicated (gee, a picture here would be easier to understand this), but otherwise you can go into the CW help file index and see what is documented there under the 'subproject' keyword?

Erich
0 Kudos