Unix Programming - Problem Finding Needed C/C++ Library For Newly Installed Program

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > May 2006 > Problem Finding Needed C/C++ Library For Newly Installed Program





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Problem Finding Needed C/C++ Library For Newly Installed Program
Hal Vaughan

2006-05-18, 7:15 pm

I am trying to install RealVNC on a number of different systems that we'll
be using. _There's no problem with Windows, but on Linux, on a number of
systems ask for libstdc++-libc6.2-2.so.3. _On my system, that file is a
symlink to libstdc++-3-libc6.2-2-2.10.0.so. _As I understand that, it means
that I can use a symlink like this in most cases and not have a problem.

I'm not a C programmer, but from what I've gleaned, as long as the symlink
is to a late enough library there isn't a problem. _What I need to do is
work out an algorithm for what file I should symlink to. _For example, I
don't know what the "3" in the 2nd filename represents and if it is
important. _If I can just list the library directories with wildcards, get
a list of files, and sort them so the last one has the highest value, then
link to that, it'd be great.

What are the rules for these types of symlinks? _Should I just look for any
version of the library that is the same or greater? _Do I pay attention to
the version numbers after the "++-" and before the "libc"? _Or do I only
have to pay attention to the numbers after "libc" and the ".so" at then
end?

What criteria do I use to try to determine which file I should symlink to?

Thanks for any help on this!

Hal
Robert Harris

2006-05-19, 7:17 am

Hal Vaughan wrote:
> I am trying to install RealVNC on a number of different systems that we'll
> be using. There's no problem with Windows, but on Linux, on a number of
> systems ask for libstdc++-libc6.2-2.so.3. On my system, that file is a
> symlink to libstdc++-3-libc6.2-2-2.10.0.so. As I understand that, it means
> that I can use a symlink like this in most cases and not have a problem.
>
> I'm not a C programmer, but from what I've gleaned, as long as the symlink
> is to a late enough library there isn't a problem. What I need to do is
> work out an algorithm for what file I should symlink to. For example, I
> don't know what the "3" in the 2nd filename represents and if it is
> important. If I can just list the library directories with wildcards, get
> a list of files, and sort them so the last one has the highest value, then
> link to that, it'd be great.
>
> What are the rules for these types of symlinks? Should I just look for any
> version of the library that is the same or greater? Do I pay attention to
> the version numbers after the "++-" and before the "libc"? Or do I only
> have to pay attention to the numbers after "libc" and the ".so" at then
> end?
>
> What criteria do I use to try to determine which file I should symlink to?
>
> Thanks for any help on this!
>
> Hal


Don't mess with symlinks. Binary interfaces have evolved over time and
often programs built with specific versions of libraries have to be
loaded with similar versions at run time. And C++ binary interfaces
really have changed through different compiler versions.

The program ldconfig(1) actually creates the version symlinks.

Your distribution probably supplies older binary C++ libraries as well
as the current one. In my distribution (Debian), type:

apt-cache search libstdc++

to get the list of available ones.

For the full story about versioning, see, for example,

<http://people.redhat.com/drepper/elftut1.ps>

Robert
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com