How do I select a version of libstdc+ to link against?
Jonathan Wakely
jwakely.gcc@gmail.com
Wed Sep 21 16:52:00 GMT 2011
On 21 September 2011 17:22, Paolo Carlini wrote:
> On 09/21/2011 06:15 PM, David Aldrich wrote:
>>
>> Hi
>>
>> I am running Ubuntu 10.04, which has g++ 4.4 installed by default. I want
>> to run g++ 4.1.3 so I installed 4.1.3 and set is as the default using
>> update-alternatives. However, I suspect that although I am compiling with
>> 4.1.3, I am actually linking to libstdc+ 4.4.
>
> Note that your issues have very little to do with the *development* of
> libstdc++. Actually, I would say have little to do also with the *use* of
> GCC as GCC, these are generic Unix / Linux questions, thus I'm not even sure
> about recommending gcc-help instead.
I think this might even qualify as an Ubuntu question, as I have no
idea what update-alternatives does, so the answer probably partly
depends on that.
If the Ubuntu packages are sane then each gcc should link against its
own libstdc++, but of course there are two types of linking that
happen when using shared libraries: what the linker (ld) does when
called by gcc, and what the dynamic linker (ld.so) does at runtime,
and they could be using different versions of libstdc++. The former
should do the right thing (if the Ubuntu packages are sane) and
controlling what the latter does is documented at:
http://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic
More information about the Libstdc++
mailing list