On Mon, Jul 24, 2000 at 07:09:17PM +0530, Venkata Rajesh Velamakanni wrote:
> #include <stdio.h>
> void
> library() {
>
> FILE *f;
> f=fopen("test2","r");
> fclose(f);
Bug: You don't verify if the fopen was successful.
> I am doing following steps to build the library:
>
> 1. cc -c -o library.o library.c
> 2. ld -dn -G -Bstatic -o -libmylib.a library.o
> 3. cc -lmylib -o application application.c
> 4. ./application
Don't call ld directly if you don't know exactly what you're doing. You
just missed linking a ton of other files. Do something like
``cc -shared -o library.so library.c''.
Ralf