Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > shared libraries version

Reply
Thread Tools

shared libraries version

 
 
Stu
Guest
Posts: n/a
 
      05-03-2004
I have sample c++ program, which I am compiling (see steps below) on
Solaris 2.8, which uses the following version of g++.

/usr/local/bin/GNU/bin/g++ -c ./test.cpp -o test.o
/usr/local/bin/GNU/bin/g++ -g test.o -o test


/usr/local/bin/GNU/bin/g++ -v
Reading specs from /usr/local/bin/GNU/lib/gcc-lib/sparc-sun-solaris2.8/3.3.2/spe
cs
Configured with: /db_backups/gcc/srcdir/gcc-3.3.2/configure --prefix=/usr/local/
bin/GNU --disable-nls --enable-threads=posix --enable-languages=c,c++ --with-sys
tem-zlib
Thread model: posix
gcc version 3.3.2

An ldd on the executable repors that it needs verion 5 of libstdc++.so.

ldd ./test
libstdc++.so.5 => /usr/local/bin/GNU/lib/libstdc++.so.5
libm.so.1 => /usr/lib/libm.so.1
libgcc_s.so.1 => /usr/local/bin/GNU/lib/libgcc_s.so.1
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
/usr/platform/SUNW,Ultra-Enterprise/lib/libc_psr.so.1


Why is g++ referencing a specific version of a library instead of a generic
name? I would have hope do seen libstdc++.so as the requirement.

This way if there was a bug in libstdc++.so.5, version libstdc++.so.6 can be
installed, re-named to libstdc++.so and this would not require me to
re-build my executables.

Can you tell g++ to use libstdc++.so instead of libstdc++.so.5

Thanks in advance to all who answer
 
Reply With Quote
 
 
 
 
Karthik
Guest
Posts: n/a
 
      05-03-2004
Stu wrote:


>
> Why is g++ referencing a specific version of a library instead of a generic
> name? I would have hope do seen libstdc++.so as the requirement.


That is actually a symbolic link, that links to the latest version
of the library. Otherwise there is no way you can figure out which
version of stdc++ you are running . Anyway from the perspective of a
programmer, it is transparent and does not really matter.

Having said all these things, I feel this is off-topic for current
newsgroup CLC++ and hence following up with gnu.gcc.help which i feel is
the most appropriate for this.

--
Karthik.
Humans please 'removeme_' for my real email.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
standard libraries don't behave like standard 'libraries' Sriram Srinivasan Python 13 11-12-2009 06:05 PM
Re: Where to get stand alone Dot Net Framework version 1.1, version2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? MowGreen [MVP] ASP .Net 5 02-09-2008 01:55 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? PA Bear [MS MVP] ASP .Net 0 02-05-2008 03:28 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? V Green ASP .Net 0 02-05-2008 02:45 AM
Using mandatory libraries (custom class loading vs. expanding libraries) Karsten Wutzke Java 21 06-29-2007 09:25 PM



Advertisments