This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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: g++ -ldl


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



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