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]

Re: Adding a function to glibc?


> Exactly what command line did you use to link your application?
>
> The above command line is incomplete.
>
> You need something like this:
> $ gcc -I/${nheaders} -I/${nkheaders} \
> -Wl,--rpath=${SYSROOT}/lib:${SYSROOT}/usr/lib \
> -Wl,--dynamic-linker=${SYSROOT}/lib/ld-linux.so.2 \
> -o application file1.o file2.o file3.o
>

There should have been a mistake from me when typing the command. I
know that I need to specify the source files too.
So, I should have done this:

$ gcc -I/${nheaders} -I/${nkheaders} -Wl,--rpath=${SYSROOT}/lib
-Wl,--dynamic-linker=${SYSROOT}/lib/ld-2.10.90.so test.c
/tmp/ccuMcYGm.o: In function `main':
test.c:(.text+0x11): undefined reference to `putct'
collect2: ld returned 1 exit status

I actually have two ld files, I used both but it doesn't work.
How can I determine it is actually trying to link using the new library?
I'm worried if I have done something wrong when compiling the library
or I'm not specifying the right path.


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