【help】about math functions

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

【help】about math functions

1,756 次查看
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

标签 (1)
0 项奖励
回复
2 回复数

946 次查看
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 项奖励
回复

946 次查看
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 项奖励
回复