Hi,
> Venkata Rajesh Velamakanni [SMTP:[EMAIL PROTECTED]] asked:
>
> This is regarding a query on linking libraries.
> I would like to know whether anyone has faced
> this problem.
>
> I have a application, in which I open a file(test1),
> and then I am calling a function defined in My library.
> Inside this function I am trying open someother file
> (test2) and then closing the file. While closing this
> file(test2).. it errors out saying "Segmentation fault".
>
[...]
>
>
Does test2 exist? You open it in read mode and close it
without testing that the open was successful. Try this:
>
> Library.c
>
> #include <stdio.h>
>
> void
> library() {
>
if( f=fopen("test2","r") ){
fclose(f);
} else {
printf("Open in library() failed!\n");
}
> }
>
HTH,
--
Thomas B�tzler, System Administrator, Network Operations EMEA
Harbinger, e-Business Connectivity Group, a part of Peregrine
Steinh�userstra�e 22 phone: +49-721-98143-110
D-76135 Karlsruhe / Germany fax: +49-721-98143-196