This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: undefined reference to `_exit


On Tue, Dec 13, 2011 at 6:42 PM, Rohit Arul Raj <rohitarulraj@gmail.com> wrote:
> On Tue, Dec 13, 2011 at 3:55 PM, Can Finner <can.finner@gmail.com> wrote:

>> Hi, I also got a question on this.
>> I built cross toolchain for arm-none-eabi with newlib.
>> for c++ programs, the below command:
>> arm-none-eabi-g++ hello.cc --specs=rdimon.specs -lc -lrdimon -lc -o a.out
>>
>> complains that:
>> --------------------------------
>> libc.a(lib_a-exit.o): In function `exit':
>> exit.c:(.text+0x2c): undefined reference to `_exit'
>> libc.a(lib_a-abort.o): In function `abort':
>> abort.c:(.text+0x10): undefined reference to `_exit'
>> libc.a(lib_a-signalr.o): In function `_kill_r':
>> signalr.c:(.text+0x1c): undefined reference to `_kill'
>>
>> whle below command is ok;
>> arm-none-eabi-g++ hello.cc --specs=rdimon.specs -lg -lrdimon -lg -o a.out
>>
>> BTW, the hello.cc is just a c++ hello world program.
>>
>> Thanks
>> --
>> Regards.
>
> Please post a new thread for different queries.
>
> In your case, you are missing the system call library which you are
> supposed to provide (even empty routines or routines with minimal
> functionality) to allow your programs to link with the subroutines in
> libc.a
>
> The list of sub-routines to be provided are available in:
> http://sourceware.org/newlib/libc.html#Syscalls

Hi,
Actually I think it is on the same topic.
there is no difference between libc.a and libg.a generated.
My question is why libc.a failed while linking, what's the difference?
So IMHO it is a libc.a Vs. libg.a question.

Thanks anyway.

-- 
Regards.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]