This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Undefined reference to '__floatsisf'

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

Parents
  • "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!

Reply
  • "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!

Children
  • "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.