【help】about math functions

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

【help】about math functions

1,222 Views
water0528
Contributor I

hello everyone. I'm using mfc 5282 .When I use a math function like 'abs' or 'sqrt',there comes a link error.

my main.c file begins as below:

 

#include "src/init/m5282evb.h"
#include "src/init/mcf5282.h"//wsyy
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

the link error is:

 

Link Error : Undefined : "sqrt"

 

ask for your help. thank you

Labels (1)
0 Kudos
2 Replies

412 Views
doom
Contributor I
- Create a stationary project with the CodeWarrior new project wizard
- Replace the file C_4i_CF_SZ_MSL.a by C_4i_CF_MSL.a
- Modify the file CodeWarrior for ColdFire Vx.x\ColdFire_Support\msl\MSL_C\MSL_ColdFire\Include\ansi_prefix.CF.size.h
as follows:
Code:
#define _MSL_FLOATING_POINT 1
//#define _MSL_NO_MATH_LIB 0
#undef _MSL_NO_MATH_LIB
#endif

#define _MSL_FLOATING_POINT_IO 1

- Add this macro to prefix text on your project settings -> C/C++ Preprocessor panel:
#define _CF_USE_FULL_LIBS_ 1

0 Kudos

412 Views
water0528
Contributor I

thanks very much. It seems that I have solved this problem.

I add the file C_4i_CF_MSL.a to my project. then i can use the math functions.

I also chek file Vx.x\ColdFire_Support\msl\MSL_C\MSL_ColdFire\Include\ansi_prefix.CF.size.h
the content in it is totally different from the one you showed. so I didn't modify it.

 

would you please tell me the opration of file  C_4i_CF_MSL.a

thank you

0 Kudos