This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

about the link error with arm-none-eabi on the eclipse environment.

Hello all

I'm struggling with link errors, "undefined referencce atan2" as well as all math library. I still dont know why it is occurred these errors. I configured the eclipse compile environment with the gnu arm tool using your doc, application note ver1.2. May you help me?

Parents
  • I had this same problem.

    The solution was:

    1- Link with GCC instead of LD (some guys recommend this, dunno where I read it, but seems to work). In your makefile replace

    LD       		:= "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-ld"
    

    With

    LD       		:= "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-gcc"
    

    2- Manually add the math lib to your libs

    #link math library.. dunno why this isn't done automatically
    
    LIBS += $(GNU_INSTALL_ROOT)/arm-none-eabi/lib/thumb/libm.a
    

    I don't know why the linker doesn't automatically link the library but this seemed to work for me.

Reply
  • I had this same problem.

    The solution was:

    1- Link with GCC instead of LD (some guys recommend this, dunno where I read it, but seems to work). In your makefile replace

    LD       		:= "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-ld"
    

    With

    LD       		:= "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-gcc"
    

    2- Manually add the math lib to your libs

    #link math library.. dunno why this isn't done automatically
    
    LIBS += $(GNU_INSTALL_ROOT)/arm-none-eabi/lib/thumb/libm.a
    

    I don't know why the linker doesn't automatically link the library but this seemed to work for me.

Children
Related