Hi Tarun,

It worked. 
Thanks.

With Regards,
Arvind Bharti

--- Tarun Dua <[EMAIL PROTECTED]> wrote:
>  gcc -o test1 test1.c -ldl
> 
> Tarun Dua
> 
> From: "Arvind Bharti" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, September 16, 2002 10:55 PM
> Subject: [ilugd]: Help on linking with shared
> libraries, libdl.so
> 
> 
> > Dear friends,
> >
> > Please help me in understanding the concept of
> Dynamic
> > loading concept of Linux.
> >
> > I am trying to use the dl library for using shared
> > libraries. but i am unable to make the executable
> > file.
> >
> > Following is the test program:
> > /* test1.c -- Example of Dynamic loading Concept
> of
> > linux */
> > #include <dlfcn.h>
> > #include <stdio.h>
> > #include <stdlib.h>
> >
> > int main()
> > {
> > void *lib;
> > const char *errmsg;
> > lib = dlopen("libdl.so", RTLD_LAZY);
> > if (lib == NULL)
> > {
> > printf("failed to open libdl.so: %s", dlerror() );
> > exit(-1);
> > }
> > else
> > {
> > printf("Successful in opening libdl.so");
> > dlclose(lib);
> > }
> > return 0;
> > }
> >
> > file://Command used by me are follwings
> > >> gcc test1.c
> > OR
> > >> gcc -c test1.c
> > >> ld -o test1 -lc test1.o
> >
> > But every time i got the error of "Undefined
> Refernce
> > of dlopen and dlerror". As libdl.so exists in one
> of
> > the standard path of library search, i.e.
> /usr/lib, i
> > don't think that there is problem in library
> > searching. Please help me.
> >
> > With Regards,
> > Arvind Bharti
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! News - Today's headlines
> > http://news.yahoo.com
> >
> >          
> ================================================
> > To unsubscribe, send email to
> [EMAIL PROTECTED] with unsubscribe in
> subject header. Check archives at
> http://www.mail-archive.com/ilugd%40wpaa.org
> >
> 
>          
> ================================================
> To unsubscribe, send email to [EMAIL PROTECTED]
> with unsubscribe in subject header. Check archives
> at http://www.mail-archive.com/ilugd%40wpaa.org
> 


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

          ================================================
To unsubscribe, send email to [EMAIL PROTECTED] with unsubscribe in subject 
header. Check archives at http://www.mail-archive.com/ilugd%40wpaa.org

Reply via email to