This is the mail archive of the
mailing list for the newlib project.
Error linking C program
- From: siv Kumar <kvkskumar1 at gmail dot com>
- To: newlib at sourceware dot org
- Date: Wed, 27 Mar 2013 10:06:01 +0530
- Subject: Error linking C program
I have built a cross compiler for Powerpc on my Centos 5.5 running on
intel pentium 4, with all the latest builds like gmp-5.1.1,
mpfr-3.1.2,mpc-1.0.1,binutils-2.23.1, bootstrap gcc-4.8.0,
newlib-2.0.0, binutils and gcc again with newlib and then gdb, in the
same order as shown above. I have seen this procedure somewhere in
internet and used it. I have tried running a simple exit program as
When I try executing it, I get the error undefined _exit
powerpc-elf-gcc -o fail fail.c -fno-builtin-exit -e 0x1000
In function `exit':
reference to `_exit'
collect2: error: ld returned 1 exit status
I have tried adding the stdlib.h and unistd.h header responsible for
_exit (found by reading exit.c file)in my program.But then it didnot
work. Could you please help me dealing with the error. I am short of
time now. Please help me.