Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Nios II linking errors

Hello!

I was debuggina program with the Nios II IDE 9.1(Sofywrae building tools for eclipse) and suddenly it hangs. Well it was not the first time, so I just restarted it, but...

Trying to cimple it again I got the following link error:

/cygdrive/e/altera/91/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/lib/libc.a(closer.o)(.text+0x18): In function `_close_r':

/build/nios2eds-gnutools-win32-9.1/bin/nios2-gnutools/src/newlib/newlib/libc/reent/closer.c:53: undefined reference to `close'

collect2: ld returned 1 exit status

make: *** [FinalEthernetPort.elf] Error 1

I didn't do anything, it's the same source ode than before, the same flags. Why is this happening?

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Try a clean. Then compile. If that doesn't fix it, I would ask if you've changed any settings in your BSP.

    Jake
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    When 'enable_exit' is activated, I have the same message: 'undefined reference to close' :S

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you are using Vista or Windows 7, try running the Nios II 9.1 Software Build Tools for Eclipse as Administrator. I have found that if I don't do this, I get all sorts of problems like this.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for the replys

    I solved it adding the option "-u close" to the linker, now it works correctly. I still need to find out how that happenned, beacause I didn't need that flag initially.

    Thank you!

    Bye!