Using pow on MCF52234 with CW 5.9.0

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

Using pow on MCF52234 with CW 5.9.0

2,170 Views
Smally
Contributor I

Hi Team,

I want to use the function pow in my project but without success.
I have implemented following Librarys:
C_4i_cf_msl.a (was C_4i_cf_sz_msl.a before)
C_4i_cf_runtime.a
Fp_coldfire.a
 
I activated “Require function Prototypes” on dialog “C/C++ language”.
I also added <math.h>.
If I compile I first get the error “function has no prototype”. If I disable “require function prototypes” or give it a prototype by hand (double   pow(double x, double y):smileywink: the message disappears.
After compilation and programming to the device I get a crash when “pow” has been reached. What did I do wrong?

Best regads

Smally

Labels (1)
0 Kudos
Reply
3 Replies

687 Views
J2MEJediMaster
Specialist I
The pow() function is a floating-point function and requires the use of floats. You need to link in the floating-point libraries.

---Tom

0 Kudos
Reply

687 Views
Smally
Contributor I

Hi Tom,

 
thank you fort he quick answer.
I have added “c_4i_cf_runtime.a” with no change. Still having the error “no prototype”.

If I compile and run the function will be found even without the “c_4i_cf_runtime” but will chrash somewhere. Is it because I have to set the __CF_USE_FULL_LIBS somewhere when not using the small lib. But where is the prototype of the pow function? Math.h will not help

 
smally

0 Kudos
Reply

687 Views
J2MEJediMaster
Specialist I
You need to make sure that the flag _MSL_FLOATING_POINT is set to ON. I think what you want to add is C_4iCF_MSL.a. Study chapter 19, particularly Tables 19.2 and 19.6, in the ColdFire_Build_Tools_Reference.pdf document.

---Tom
0 Kudos
Reply