Creating library file using libmaker tools in CW 5.1

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Creating library file using libmaker tools in CW 5.1

1,324件の閲覧回数
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,294件の閲覧回数
KKumar
Contributor II

Thanks @ZhangJennie 

 

0 件の賞賛
返信

1,298件の閲覧回数
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 件の賞賛
返信