Creating library file using libmaker tools in CW 5.1

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

Creating library file using libmaker tools in CW 5.1

1,329 次查看
KKumar
Contributor II

Hi NXP,

 

I have some *.c file to put in a library file. i dont know create how to use libmaker tool in CW5.1.

Could you help me to make library file in CW 5.1

 

 

 

0 项奖励
回复
2 回复数

1,299 次查看
KKumar
Contributor II

Thanks @ZhangJennie 

 

0 项奖励
回复

1,303 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi @KKumar 

To create .lib file, you need follow the steps below.(please also refer the attached mylib project)

  1. Create one project with wizard.(I use NE64 as target chip)
  2. change the file name main.c as the lib name (in sample is mylib.c)
  3. define the lib functions in mylib.c
  4. add header file mylib.h in the project, and declare the prototype of the lib functions in it.
  5. add “#include mylib.h” in  mylib.c
  6. delete the following files from the project: start12.c, datepage.c, *.prm, MC9S12NE64.h, MC9S12NE64.c, ansibi.lib.c
  7. Press ALT+F7, in “Target Setting”, select “Libmaker for HC12” as Linker in the second droplist. In “Libmaker for HC12”, name your Library Filename.(the sample use mylib.lib), Click OK to close this window.
  8. Compile again. In “bin” folder of the lib project, you could find the lib file named “mylib.lib”

 

The following is how to use the lib file in the project:

  1. copy “mylib.lib” and “mylib.h” to your current project folder.
  2. import “mylib.lib” and “mylib.h” in your current project
  3. add “#include "mylib.h"”in the main.c file

then you can use the lib functions in your current project code.

Hope this will help you.

Have a nice day,

Jun Zhang

0 项奖励
回复