 | Discussion Forum |  |
|
|
Undefined reference to '__floatsisf'Next Thread | Thread List | Previous Thread Start a Thread | Settings | Details | Message |
|---|
Read-Only Author Mauro Fuentes Posted 19-Aug-2004 21:41 GMT Toolset ARM |  Undefined reference to '__floatsisf' Mauro Fuentes hello,
I'm using uVision3 on a lpc2129 target. While trying to compile and link this:
int a; float b: a++; b = a;
I get this error when linking: "error: undefined reference to '__floatsisf'"
Any idea of why this is happening?
thanks in advance,
MAURO | | Read-Only Author Andy Neil Posted 19-Aug-2004 23:47 GMT Toolset ARM |  RE: Undefined reference to '__floatsisf' Andy Neil does the version you have support floating-point (other eval versions don't) | | Read-Only Author Mauro Fuentes Posted 19-Aug-2004 23:53 GMT Toolset ARM |  RE: Undefined reference to '__floatsisf' Mauro Fuentes Quoting the Restrictions in Keil website:
"The GNU ARM tools (compiler, assembler, and so on) that are provided are not limited or restricted in any way."
that means that i should be able to use floating point variables, right?
So can the problem be that I should include any header file that I'm not including? | | Read-Only Author Andy Neil Posted 20-Aug-2004 00:45 GMT Toolset ARM |  RE: Undefined reference to '__floatsisf' Andy Neil "The GNU ARM tools (compiler, assembler, and so on) that are provided are not limited or restricted in any way."
That should probably actually say that Keil have not imposed any special restrictions of their own - so you need to refer to the GNU documentation to find out about its floating-point support.
"So can the problem be that I should include any header file that I'm not including?"
You said it's a Linker error; header files have nothing whatsoever to do with the Linker, so they will make no difference to any Linker errors. You probably need to add a Library. As noted above, you will probably have to consult the GNU documentation to find out precisely what library/ies is/are required...
BTW: Even though you are using an ARM (and not a poor little 8051), floating point is still generally best avoided in embedded applications. Have you considered fixed-point arithmentic? | | Read-Only Author Keil Support, Intl. Posted 31-Aug-2004 14:30 GMT Toolset ARM |  RE: Undefined reference to '__floatsisf' Keil Support, Intl. You need to check under Project - Options - Linker - Use Math Libraries. Is this the case in your project? | | Read-Only Author Mauro Fuentes Posted 31-Aug-2004 15:06 GMT Toolset ARM |  RE: Undefined reference to '__floatsisf' Mauro Fuentes "You need to check under Project - Options - Linker - Use Math Libraries. Is this the case in your project?"
Actually the solution is pretty close to what Keil Support suggests. Under Project - Options - Linker I had checked "Do not use Standar System Libraries". Unchecking this option solved the problem.
And as a corollary. If you uncheck "Use Math libraries", and you want to use a math function (pow(), exp(), etc... ) it wont work, no matter if you #include <math.h>. So in order to use math functions "Use Math libraries" has to be checked.
Thanks for the help! | | Read-Only Author Andy Neil Posted 31-Aug-2004 23:50 GMT Toolset ARM |  RE: Undefined reference to '__floatsisf' Andy Neil "Under Project - Options - Linker I had checked 'Do not use Standar System Libraries'"
Having thus explicitly told the Linker not to use the standard libraries, it should come as no surprise to find that the standard library support for floating point is not there! Hence the error!
"And as a corollary. If you uncheck 'Use Math libraries', and you want to use a math function (pow(), exp(), etc... ) it wont work..."
Of course it won't - if the libraries aren't there, anything that tries to use them will obviously not work!
"... no matter if you #include <math.h>."
As I said earlier, "header files have nothing whatsoever to do with the Linker"
A header file simply tells the Compiler to expect that the functions will be provided elsewhere. | |
Next Thread | Thread List | Previous Thread Start a Thread | Settings |
|