[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Include lib



> From: "Per-Ola Svensson" <posa@xxxxxxx.se>
> Date: Thu, 20 Jun 2002 18:16:47 +0200

> You´r were right. I forgotten the -ldl switch to the
> linker. However, this did´t not work iver. Then the program
> using the library started there was a error message saying
> something like "BUG IN LIBRARY LD ..." and a referense to a
> funktion that I forgotten.

This is a problem I want to pursue.  How does your program open
DSOs dynamically if not through libdl?  In the link command, is
"-ldl" *before* other libraries?  It really sounds like you're
papering over a real bug or somesuch.  Can you give enough
detail to let me repeat what you're seeing?  Point to an URL for
the source if possible.

> However, the library ld included in
> the memmory images seems wery small so I added the library to
> the files directory in /usr/lib and removed the -ldl switch
> from the linker. Now it works!

I don't understand this.  You add libdl.so.2 to the image
"manually" and things work?

> One question. How do I do static linking.

-static.  It's in the manual and info pages.
Individual libraries by -Wl,-Bstatic,-lthelib,-Ddynamic

> Now, there are libraries installed used only by CSL and they
> are requiere ALOT of memmory. After the CSL is installd there
> are only a few bytes lefts and, correct me if  I am wrong, but
> will not static linking be better to use when there is only
> one program using a library?

Yes, but link *just that particular library* static.

brgds, H-P