public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: g++ -ldl
       [not found] <45170E64.2010308@telia.com>
@ 2006-09-25  1:26 ` Jeremy Sheldon
  0 siblings, 0 replies; 4+ messages in thread
From: Jeremy Sheldon @ 2006-09-25  1:26 UTC (permalink / raw)
  To: gcc-help

>From: David Sveningsson <david.sveningsson@telia.com>
>To: Jeremy Sheldon <jeremy_sheldon@hotmail.com>
>Subject: Re: g++ -ldl
>Date: Mon, 25 Sep 2006 01:01:56 +0200
>
>Jeremy Sheldon wrote:
> > would someone please point me to the correct place to find information
> > on what the -ldl option would do for g++ ?  I've looked at the gcc man
> > page and browsed google for a while and can't find much information on
> > it.  I have a situation where using it clears up a few "undefined
> > reference to `dlopen'" errors and would like to understand why.
>The -l flag specifies a library to link against. In this case you are
>linking with the library dl, which is if I recall correctly a library to
>handle dynamic libraries in you application. At least dl contains dlsym,
>dlopen, dlclose etc.

Thank you Mr. Sveningsson.  This is exactly the information for which I was 
hunting.

>You should be able to find out information about the dl library using these
>commands:
>man dlopen
>man dlclose
>man dlsym
>man dlerror
>
>HTH,
>--Eljay

Eljay, I had been in that manual and, sure enough, way down at the bottom in 
the "example" section the -ldl option is on the "how to compile the example" 
line.  It was one of the things that caused me to believe that it was, in 
fact, the correct way to compile my code.  However, it isn't explained at 
all and I still questioned exactly what it did.

Much Thanks to both of you who responded!

sheldon


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: g++ -ldl
  2006-09-24 21:36 Jeremy Sheldon
  2006-09-24 23:12 ` John (Eljay) Love-Jensen
@ 2006-09-25  1:35 ` Amit Choudhary
  1 sibling, 0 replies; 4+ messages in thread
From: Amit Choudhary @ 2006-09-25  1:35 UTC (permalink / raw)
  To: Jeremy Sheldon, gcc-help

Hi Sheldon,

If you are using any of the following functions - dlopen(),
dladdr(), dlerror(), dlsym(), or dlclose() then you need to link
with the libdl.so library. Hence, you require the option -ldl.

If you are not using them directly, then probably some other
code  is using them.

-Amit

--- Jeremy Sheldon <jeremy_sheldon@hotmail.com> wrote:

> would someone please point me to the correct place to find
> information on 
> what the -ldl option would do for g++ ?  I've looked at the
> gcc man page and 
> browsed google for a while and can't find much information on
> it.  I have a 
> situation where using it clears up a few "undefined reference
> to `dlopen'" 
> errors and would like to understand why.
> 
> sheldon
> 
> 
> 




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: g++ -ldl
  2006-09-24 21:36 Jeremy Sheldon
@ 2006-09-24 23:12 ` John (Eljay) Love-Jensen
  2006-09-25  1:35 ` Amit Choudhary
  1 sibling, 0 replies; 4+ messages in thread
From: John (Eljay) Love-Jensen @ 2006-09-24 23:12 UTC (permalink / raw)
  To: Jeremy Sheldon, gcc-help

Hi Sheldon,

You should be able to find out information about the dl library using these commands:
man dlopen
man dlclose
man dlsym
man dlerror

HTH,
--Eljay

^ permalink raw reply	[flat|nested] 4+ messages in thread

* g++ -ldl
@ 2006-09-24 21:36 Jeremy Sheldon
  2006-09-24 23:12 ` John (Eljay) Love-Jensen
  2006-09-25  1:35 ` Amit Choudhary
  0 siblings, 2 replies; 4+ messages in thread
From: Jeremy Sheldon @ 2006-09-24 21:36 UTC (permalink / raw)
  To: gcc-help

would someone please point me to the correct place to find information on 
what the -ldl option would do for g++ ?  I've looked at the gcc man page and 
browsed google for a while and can't find much information on it.  I have a 
situation where using it clears up a few "undefined reference to `dlopen'" 
errors and would like to understand why.

sheldon


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-09-25  1:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <45170E64.2010308@telia.com>
2006-09-25  1:26 ` g++ -ldl Jeremy Sheldon
2006-09-24 21:36 Jeremy Sheldon
2006-09-24 23:12 ` John (Eljay) Love-Jensen
2006-09-25  1:35 ` Amit Choudhary

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).