Enabling floating point

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

Enabling floating point

跳至解决方案
2,957 次查看
jcdammeyer
Contributor III

I need to use the log() function so I've included float.h.  Written the code.  It compiles but I get a linker error.that the _DSFLOAT and so on are not found.  I've checked off float=IEEE32 in the Code Generation line.  Oddly though there's also a -D__NO_FLOAT__ in the command line.  I can't find any check box to remove that.  It doesn't matter that I remove it.  I suspect I have to change my ansixbi.lib to one that handles floats.

So:

1. Other than editing how do I remove the -D__NO_FLOAT__

2. How do I decide which library to use.

 

Thanks

John

标签 (1)
1 解答
1,978 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi John,

to work with log(), you need enable floating support.

there are only two floating point selections in wizard when you creating a new project:

- Float is IEEE32, double is IEEE32

- Float is IEEE32, double is IEEE64

floating in wizard.JPG.jpg

The different selection is with different lib. For example, if we want change project from none floating support to “Float is IEEE32, double is IEEE32”, we need use ansibf.lib rather than ansib.lib.

I list the difference of this two lib files to you for your convenience:

=======================

Mb IEEE32/32 ELF/DWARF ansib.lib     -W2 -Os -Mb

Mb IEEE32/64 ELF/DWARF ansibf.lib    -W2 -Os -Mb –Cf

==========================

You need enable –Cf in the compiler command line as well.

if use floating library, "-D__NO_FLOAT__" is not allowed in compiler command line. if it is there, please manually remove it.

===============================================

this answer is for you. if it helps, please click on "correct answer " button. thanks!

Best Regards,

Zhang Jun

在原帖中查看解决方案

3 回复数
1,979 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi John,

to work with log(), you need enable floating support.

there are only two floating point selections in wizard when you creating a new project:

- Float is IEEE32, double is IEEE32

- Float is IEEE32, double is IEEE64

floating in wizard.JPG.jpg

The different selection is with different lib. For example, if we want change project from none floating support to “Float is IEEE32, double is IEEE32”, we need use ansibf.lib rather than ansib.lib.

I list the difference of this two lib files to you for your convenience:

=======================

Mb IEEE32/32 ELF/DWARF ansib.lib     -W2 -Os -Mb

Mb IEEE32/64 ELF/DWARF ansibf.lib    -W2 -Os -Mb –Cf

==========================

You need enable –Cf in the compiler command line as well.

if use floating library, "-D__NO_FLOAT__" is not allowed in compiler command line. if it is there, please manually remove it.

===============================================

this answer is for you. if it helps, please click on "correct answer " button. thanks!

Best Regards,

Zhang Jun

1,978 次查看
jcdammeyer
Contributor III

Thanks.  That was helpful.  I did enabled the -Cf flag.  U also removed the "-D__NO_FLOAT__" although I'm puzzled where it came from.  I couldn't find any reference to it in the help files. And I had changed the lib file to the one you suggested.  Other than the -Cf flag everything was done manually.  I guess you're saying there is no automatic dialog approach to make these changes.  I'm good with that.  Thanks again.

John

1,978 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi John, You are welcome! Best Regards, Zhang Jun

0 项奖励
回复