[lug] Shared libraries

Jeffrey Haemer jeffrey.haemer at gmail.com
Mon Nov 9 17:29:17 MST 2009


So, sounds like you're saying the package installation should have made the
other link, and if it didn't, making it by hand's a perfectly good hack.
Yes?

On Mon, Nov 9, 2009 at 5:14 PM, Zan Lynx <zlynx at acm.org> wrote:

> On 11/9/09 4:52 PM, Jeffrey Haemer wrote:
> > I have a build where the link line contains "-lssh2" .  I have only
> > /usr/lib/libssh2.1 and /usr/lib/libssh2.1.0.0
> >
> > ldconfig will figure out to symlink libssh2.so.1.0.0 to libssh2.so.1, if
> > it isn't linked already.  (It is.)  Do I have to manually link
> > libssh2.so.1 to libssh2.so , or should some other utility be doing that?
> >
> > (I did the link by hand, so I'm really asking, "What should I have
> done?")
> >
>
> ldconfig will create the link for the library's SONAME. The SONAME is
> written into the ELF header. You can see it with "readelf -d
> /lib/libc.so.6" (for example).
>
> When a program is built (with GCC for example) it links against the
> SONAME of each shared library.
>
> So there are two symlinks. One is made by ldconfig. This one is from a
> very specific library version to a more general version. The other
> symlink is for building against the library and it is the *most* general
> version and is usually linked to the most recent version.
>
> Programs need /usr/lib/libssh2.so.1.0.0 and libssh2.so.1 in order to
> run. They need /usr/lib/libssh2.so in order to build.
>
> In RedHat world, the -devel package usually contains the
> /usr/lib/libssh2.so symlink needed for building.
>
> --
> Zan Lynx
> zlynx at acm.org
>
> "Knowledge is Power.  Power Corrupts.  Study Hard.  Be Evil."
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#hackingsociety
>



-- 
Click to Call Me Now! --
http://seejeffrun.blogspot.com/2009/09/call-me-now.html

Jeffrey Haemer <jeffrey.haemer at gmail.com>
720-837-8908 [cell],  @goyishekop [twitter]
http://www.youtube.com/user/goyishekop [vlog]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20091109/e5443781/attachment.html>


More information about the LUG mailing list