Link Error: undefined 'sqrt', 'sin', 'cos', 'fabs'

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

Link Error: undefined 'sqrt', 'sin', 'cos', 'fabs'

跳至解决方案
1,246 次查看
zili
Contributor II

The CodeWarrior IDE version is 5.9.0.

Even if 'math.h' is included, the Link error still appears, while there is no problem with compiling.

0 项奖励
1 解答
1,030 次查看
stanish
NXP Employee
NXP Employee

Hi,

First please check your compiler floating point setup:

If you don't require double precision floating point I'd recommend you to select "SPFP_Only" option since it generate most efficient SPFP code.

pastedImage_1.png

Next step is to add proper standard libraries (MSL + Runtime) that match with floating point option selected.

e.g.for VLE project,where char = unsigned char, and SPFP_Only floating point selected:

Use this runtime library:

"<CW for MPC55xx and MPC56xx 2.10>\PowerPC_EABI_Support\Runtime\Lib\Runtime.PPCEABI.V.SP.UC.a"

 

And this MSL library:

 

"<CW for MPC55xx and MPC56xx 2.10>\PowerPC_EABI_Support\MSL\MSL_C\PPC_EABI\Lib\MSL_C.PPCEABI.bare.V.SP.UC.a"

 

pastedImage_2.png

 

For more information about the libraries available please see the Build tools reference manual:

"<CW for MPC55xx and MPC56xx 2.10>\Help\PDF\Power Architecture Build Tools Reference.pdf", sections "Choosing an MSL Library", "Choosing a Runtime Library".

 

Hope it helps.

Stan

在原帖中查看解决方案

0 项奖励
3 回复数
1,031 次查看
stanish
NXP Employee
NXP Employee

Hi,

First please check your compiler floating point setup:

If you don't require double precision floating point I'd recommend you to select "SPFP_Only" option since it generate most efficient SPFP code.

pastedImage_1.png

Next step is to add proper standard libraries (MSL + Runtime) that match with floating point option selected.

e.g.for VLE project,where char = unsigned char, and SPFP_Only floating point selected:

Use this runtime library:

"<CW for MPC55xx and MPC56xx 2.10>\PowerPC_EABI_Support\Runtime\Lib\Runtime.PPCEABI.V.SP.UC.a"

 

And this MSL library:

 

"<CW for MPC55xx and MPC56xx 2.10>\PowerPC_EABI_Support\MSL\MSL_C\PPC_EABI\Lib\MSL_C.PPCEABI.bare.V.SP.UC.a"

 

pastedImage_2.png

 

For more information about the libraries available please see the Build tools reference manual:

"<CW for MPC55xx and MPC56xx 2.10>\Help\PDF\Power Architecture Build Tools Reference.pdf", sections "Choosing an MSL Library", "Choosing a Runtime Library".

 

Hope it helps.

Stan

0 项奖励
1,030 次查看
zili
Contributor II

Hi Stan,

It's working fine now. Thank you very much.

0 项奖励
1,030 次查看
Carlos_Mendoza
NXP Employee
NXP Employee


Hi zili,

Could you tell us which MCU are you using?

Thanks in advance!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 项奖励