This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Undefined reference to _exit



Hello,

I am trying to compile for my EK-LM4f120XL via Eclipse/CDT in Linux. I am using the summon-arm-toolchain found here. (If there is a better/different toolchain you think I should be using, I'm open to suggestions.)

I've added the following library search paths based on copying from Code Composer projects:

  • /home/david/stellaris/toolchain/arm-none-eabi/lib
  • /home/david/stellaris/toolchain/arm-none-eabi/include

Along with adding "c" as a specific library to search for. In the linking stage I get "In function `exit': undefined reference to `_exit'.

Full output:

make all
Building file: ../Blinky.c
Invoking: Cross GCC Compiler
/home/david/stellaris/toolchain/bin/arm-none-eabi-gcc -I/home/david/stellaris/StellarisWare -I/home/david/stellaris/toolchain/arm-none-eabi/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Blinky.d" -MT"Blinky.d" -o "Blinky.o" "../Blinky.c"
Finished building: ../Blinky.c

Building target: Blinky.elf
Invoking: Cross GCC Linker
/home/david/stellaris/toolchain/bin/arm-none-eabi-gcc -L/home/david/stellaris/toolchain/arm-none-eabi/lib -L/home/david/stellaris/toolchain/arm-none-eabi/include -o "Blinky.elf" ./Blinky.o -lc -ldriverlib-cm4f
/home/david/stellaris/toolchain/arm-none-eabi/lib/libc.a(lib_a-exit.o): In function `exit':
/home/david/stellaris/summon-arm-toolchain/build/arm-none-eabi/newlib/libc/stdlib/../../../../../gcc-linaro-4.7-2012.12/newlib/libc/stdlib/exit.c:65: undefined reference to `_exit'
collect2: error: ld returned 1 exit status
make: *** [Blinky.elf] Error 1