Sponsored Content
Top Forums Programming Issues with two versions of libstdC++.so Post 302889104 by Praveen_218 on Wednesday 19th of February 2014 01:11:59 AM
Old 02-19-2014
Hi Jim,
Thanks for your response to my query.
No, I don't have the option to re-compile the library (say libxyz.so) and this is a black box to me being a 3rd party library package already compiled for my platform. This library using an older version of libstdc++.so.5; however my platform currently has libstdc++.so.6 (as well as libstdc++.so.5 co-existing) and the g++ compiler by default uses libstdc++.so.6 to link any code compiled on my platform (however gcc picks up libstdc++.so.5 by default).

Hence compiling a program which also uses libxyz.so through g++ is creating an undesired scenario by linking to some function calls using libstdc++.so.6 (by default) and some function calls residing into the library libxyz.so also is linked to my program as their API is called but those API's function definition has already linked to libstdc++.so.5

Hence I get an executable which has function calls linking to two versions of libstdc++.so. This creates problem while execution and dumps code.

All I need is a way to override the library selection behavior by the compiler/linker so that I can choose to link to a particular version of my choice at the link time.

I essentially want to link all my programs to libstdc++.so.5 and NOT with libstdc++.so.6

I tried "ldconfig" utility to change behavior by following (as a root):

Code:
# ldconfig -p > ldconf.conf

The file "ldconf.conf" thus produced had libstdc++.so.6 listed just prior to libstdc++.so.5; so I swapped their positions and did the following:

Code:
# ldconfig -f ldconf.conf

I received errors like (didn't work):
Code:
# ldconfig -f ldconf.conf
...
...
ldconfig: > /usr/lib64/libtag.so.1 is not a known library type
ldconfig: > /usr/lib64/libsysfs.so.2 is not a known library type
ldconfig: > /usr/lib64/libstdc++.so.5 is not a known library type
ldconfig: > /usr/lib/libstdc++.so.5 is not a known library type
ldconfig: > /usr/lib64/libstdc++.so.6 is not a known library type
ldconfig: > /usr/lib/libstdc++.so.6 is not a known library type
ldconfig: > /usr/lib/libstdc++-libc6.2-2.so.3 is not a known library type
ldconfig: > /usr/lib64/libstartup-notification-1.so.0 is not a known library type
ldconfig: > /usr/lib64/libsss_idmap.so.0 is not a known library type
ldconfig: > /usr/lib64/libssl3.so is not a known library type
...
...
ldconfig: > /lib64/ld64.so.1 is not a known library type
ldconfig: > /lib/ld.so.1 is not a known library type
ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied

 

8 More Discussions You Might Find Interesting

1. Programming

Link against a particular version of libstdc++

Our development machines have libstdc++.so.5 and libstdc++.so.6. When we build our native code, it uses libstdc++.so.6. Is there anyway I can force it to use libstdc++.so.5 instead ? $ ldd try /usr/lib/libcwait.so (0x00655000) libstdc++.so.6 => /usr/lib/libstdc++.so.6... (5 Replies)
Discussion started by: vino
5 Replies

2. HP-UX

Is there any way to get old HP-UX versions?

I got my hands on a HP9000/380 and need a (really) old version of HP-UX, like 7 or 8. Is there any vendor who sells older versions? I did a quick search here and checked the FAQ and HPs HP-UX site but couldn't find anything. :confused: Any help is appreciated! (4 Replies)
Discussion started by: dlundh
4 Replies

3. AIX

libstdc++.a (libstdc++.so.5) issue on AIX 5.2

hello everybody i am new on the AIX environment and i have faced an issue while running pstill it can't find ibstdc++.a (libstdc++.so.5) although i have the latest GCC and libstdc 4.0.0 i guess. So to resolve the problem i have got an old versions that i want to install on AIX: ... (5 Replies)
Discussion started by: eternalflame
5 Replies

4. Ubuntu

how to recover libstdc++.so.6

Hi! I'm using Ubuntu Karmic and I lost libstdc++.so.6. Is there a way to recover it?.. Thanks in advance (0 Replies)
Discussion started by: Sapfeer
0 Replies

5. Red Hat

Unable to find libstdc++-libc6.2-2.so.3

Hi all, I am working on Red Hat Enterprise Linux ES release 4 (Nahant) with kernel 2.6.9-5 and try to install one application but unable to install it. When I am trying to install it,it is throwing the following error-- To resolve it,I installed gcc 4.0.0 and when I am trying to see gcc... (2 Replies)
Discussion started by: smartgupta
2 Replies

6. UNIX for Dummies Questions & Answers

[Solved] Packages required - Libaio.so.1 - Libstdc++so.6

hi guys I have to install a software that says have theses packages are required Libaio.so.1 Libstdc++so.6 are these default packages for a Suse 11 installation for instance? or do I need to download them to avoid dependency issues thanks a lot ---------- Post updated at 10:00 PM... (0 Replies)
Discussion started by: kopper
0 Replies

7. HP-UX

hpux vnc 4.1.3 libstdc++

It took me a while, but I found the right libsdc++ for the current free vnc 4.1.3, deep in this: http://mirrors.develooper.com/hpux/gcc-3.3.2-11.00.sd.bz Merijn's HP-UX software Download Section for ITRC members is a rich source for old libraries. So if you cannot find the right depot or... (0 Replies)
Discussion started by: DGPickett
0 Replies

8. HP-UX

Versions of HP-UX

Lo guys, I've just started a new department in work and I'm going to be using HP-UX with Vi. The problem is I'm completely new to UNIX, I'm currently learning at work but I only have limited amounts of time on our dev systems. Is it possible to get a free/educational version any where? I don't... (4 Replies)
Discussion started by: john2012
4 Replies
LDCONFIG(8)						     Linux Programmer's Manual						       LDCONFIG(8)

NAME
ldconfig - configure dynamic linker run-time bindings SYNOPSIS
/sbin/ldconfig [-nNvXV] [-f conf] [-C cache] [-r root] directory... /sbin/ldconfig -l [-v] library... /sbin/ldconfig -p DESCRIPTION
ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories, /lib and /usr/lib (on some 64-bit architectures such as x86-64, lib and /usr/lib are the trusted directories for 32-bit libraries, while /lib64 and /usr/lib64 are used for 64-bit libraries). The cache is used by the run-time linker, ld.so or ld-linux.so. ldconfig checks the header and filenames of the libraries it encounters when determining which versions should have their links updated. ldconfig will attempt to deduce the type of ELF libraries (i.e., libc5 or libc6/glibc) based on what C libraries, if any, the library was linked against. Some existing libraries do not contain enough information to allow the deduction of their type. Therefore, the /etc/ld.so.conf file format allows the specification of an expected type. This is used only for those ELF libraries which we can not work out. The format is "dirname=TYPE", where TYPE can be libc4, libc5, or libc6. (This syntax also works on the command line.) Spaces are not allowed. Also see the -p option. ldconfig should normally be run by the superuser as it may require write permission on some root owned directories and files. OPTIONS
-c fmt, --format=fmt (Since glibc 2.2) Cache format to use: old, new, or compat (default). -C cache Use cache instead of /etc/ld.so.cache. -f conf Use conf instead of /etc/ld.so.conf. -i, --ignore-aux-cache (Since glibc 2.7) Ignore auxiliary cache file. -l (Since glibc 2.2) Library mode. Manually link individual libraries. Intended for use by experts only. -n Process only the directories specified on the command line. Don't process the trusted directories, nor those specified in /etc/ld.so.conf. Implies -N. -N Don't rebuild the cache. Unless -X is also specified, links are still updated. -p, --print-cache Print the lists of directories and candidate libraries stored in the current cache. -r root Change to and use root as the root directory. -v, --verbose Verbose mode. Print current version number, the name of each directory as it is scanned, and any links that are created. Overrides quiet mode. -V, --version Print program version. -X Don't update links. Unless -N is also specified, the cache is still rebuilt. FILES
/lib/ld.so Run-time linker/loader. /etc/ld.so.conf File containing a list of directories, one per line, in which to search for libraries. /etc/ld.so.cache File containing an ordered list of libraries found in the directories specified in /etc/ld.so.conf, as well as those found in the trusted directories. SEE ALSO
ldd(1), ld.so(8) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. GNU
2017-09-15 LDCONFIG(8)
All times are GMT -4. The time now is 06:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy