Using Libraries in CW

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

Using Libraries in CW

1,868 次查看
JeffB
Contributor I
I am using CW6.3 for Coldfire.
 
I have sucessfully created a library of my low level functions and have been able to include the library into another project.
 
The problem is that function parameters are not getting passed into the library functions.
No matter what value is passed, when I get to the library function it is always zero.
 
Also, what is the difference between a static and shared library?
 
Thanks
标签 (1)
标记 (1)
0 项奖励
回复
1 回复

682 次查看
CrasyCat
Specialist III

Hello

Static library are linked to the actual application. That means code from the function from the library, which are used within the application are linked to the generated .elf file.

Shared library are linked separately and may be used by several application and need to be downloaded additionally. I do not have a lot of experience with shared library and would recommend you to use static libraries as this is more common.

Regarding parameter passing, this should be working as soon as you have an appropriate prototype for your library function when building the application source file.

I would suggest you to check the preprocessor listing (Use entry preprocess when right clicking on your source file edit window). Make sure you have a prototype for each library function you are using prior to invoking them.

Additionally if your low level functions are implemented in assembly, make sure you follow the compiler parameter passing scheme when reading parameters within the function.

I hope this helps.

CrasyCat

0 项奖励
回复