How to build a library in Code Warrior 5.0

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to build a library in Code Warrior 5.0

跳至解决方案
2,386 次查看
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 
标签 (1)
标记 (1)
0 项奖励
1 解答
524 次查看
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 项奖励
3 回复数
525 次查看
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 项奖励
524 次查看
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 项奖励
524 次查看
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 项奖励