This is the mail archive of the libc-help@sourceware.org mailing list for the glibc 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]

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


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