shared libraries version

Discussion in 'C++' started by Stu, May 3, 2004.

  1. Stu

    Stu Guest

    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
    Stu, May 3, 2004
    #1
    1. Advertising

  2. Stu

    Karthik Guest

    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.
    Karthik, May 3, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Karsten Wutzke
    Replies:
    21
    Views:
    915
    Roedy Green
    Jun 29, 2007
  2. V Green
    Replies:
    0
    Views:
    844
    V Green
    Feb 5, 2008
  3. PA Bear [MS MVP]
    Replies:
    0
    Views:
    956
    PA Bear [MS MVP]
    Feb 5, 2008
  4. MowGreen [MVP]
    Replies:
    5
    Views:
    2,017
    PA Bear [MS MVP]
    Feb 9, 2008
  5. Sriram Srinivasan
    Replies:
    13
    Views:
    561
    Benjamin Kaplan
    Nov 12, 2009
Loading...

Share This Page