This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
undefined reference error while using 'gets'
- From: Rohit Arul Raj <rohitarulraj at gmail dot com>
- To: newlib at sourceware dot org
- Date: Thu, 3 Nov 2011 18:29:51 +0530
- Subject: undefined reference error while using 'gets'
Hi All,
I am using newlib v1.18 built with 'powerpc-elf' v4.5.2. While using
the 'gets' function call, i get the following error:
powerpc-elf/4.5.2/../../../../powerpc-elf/lib\libc.a(lib_a-gets.o): In
function `_gets_r':
gets.c:(.text+0x30): undefined reference to `__sfp_lock_acquire'
gets.c:(.text+0xa8): undefined reference to `__sfp_lock_release'
Based on the documentation, it has been mentioned that 'gets' is
obsolete and we need to use 'fgets'. But still i should not be getting
any undefined reference errors.
I took a look at the 'newlib\libc\stdio\gets.c' and i think we need to
include "local.h" to get these definitions. Is that right?
Let me know your suggestions.
Thanks,
Rohit