This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Adding a function to glibc?
- From: "Almohri, Hussain" <almohri at gmail dot com>
- To: libc-help at sourceware dot org
- Date: Wed, 21 Oct 2009 18:45:31 -0400
- Subject: Adding a function to glibc?
I'm doing some tests on glibc. I'd like to add new functions to it. For a
test, I create a file and put a simple function putct in it and just for
testing I put it in stdlib folder.
I added the function name to the routines section of the Makefile. In the
header file stdlib/stdlib.h, I added this line: extern int putct(int c);
I also added the function in stdlib/Versions
I run make and make install. Everything was OK. But when I write a sample
program to test this function, gcc says:
/tmp/ccq6R9BD.o: In function `main':
test.c:(.text+0x11): undefined reference to `putct'
collect2: ld returned 1 exit status
I already pointed to the modified library when running gcc.
Can somebody help me with this?
--
Hussain Almohri