make a library in CodeWarrior

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

make a library in CodeWarrior

ソリューションへジャンプ
5,833件の閲覧回数
youngcheolsong
Contributor II

Hello,

I use Codewarrior 6.3 and would like to make a common library and use it sevral projects.

How can i make library files with CodeWarrior 6.3.


ラベル(1)
タグ(2)
0 件の賞賛
返信
1 解決策
4,161件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello Youngcheol.

you can use Codewarrior create your own lib file. 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 QG8 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: start08.c, derivative.h, *.prm, MC9S08QG8.h, MC9S08QG8.c, ansiis.lib.c
  7. Press ALT+F7, in “Target Setting”, select “Libmaker for HC08” as Linker in the second droplist. In “Libmaker for HC08”, 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
  4. then you can use the lib functions in your current project code.

see attached demo code

I hope this information is helpful to you.

Best Regards,

Zhang Jun

==================================

if this answer helps, please click on "Correct Answer" button. thanks!

=====================================

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
4,162件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello Youngcheol.

you can use Codewarrior create your own lib file. 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 QG8 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: start08.c, derivative.h, *.prm, MC9S08QG8.h, MC9S08QG8.c, ansiis.lib.c
  7. Press ALT+F7, in “Target Setting”, select “Libmaker for HC08” as Linker in the second droplist. In “Libmaker for HC08”, 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
  4. then you can use the lib functions in your current project code.

see attached demo code

I hope this information is helpful to you.

Best Regards,

Zhang Jun

==================================

if this answer helps, please click on "Correct Answer" button. thanks!

=====================================

0 件の賞賛
返信
4,161件の閲覧回数
youngcheolsong
Contributor II

Hello ZhangJennie,

Thank you for your explain.

I'm clear this problem.

Thanks again.

0 件の賞賛
返信
4,161件の閲覧回数
youngcheolsong
Contributor II

Hello,

I made lib file for my project.

There are included some common library functions, like as memcpy, memset, memcmp, ... ...

How can i make a lib file that don't include a common library functions.

I will be appreciated your help.

Thanks.

0 件の賞賛
返信
4,161件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello Youngcheol.


please make sure there is no ansi related lib included in your self-made lib file.

Best Regards,

Zhang Jun

==================================

if this answer helps, please click on "Correct Answer" button. thanks!

=====================================

0 件の賞賛
返信
4,161件の閲覧回数
youngcheolsong
Contributor II

  Hello Jennie,

Thank you for your answer.

But i can't find the "no ansi related lib".

How can i set the  "no ansi related lib".

/BR

Youngcheol

0 件の賞賛
返信