Enabling floating point

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

Enabling floating point

Jump to solution
1,776 Views
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

Labels (1)
1 Solution
797 Views
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

View solution in original post

3 Replies
798 Views
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

797 Views
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

797 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

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

0 Kudos