Using Libraries in CW

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using Libraries in CW

1,494 Views
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
Labels (1)
0 Kudos
1 Reply

308 Views
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 Kudos