• Bug#266105: link problems with static libstdc++

    From Mathieu Fluhr@1:229/2 to All on Mon Aug 16 20:40:11 2004
    From: [email protected]

    Package: libstdc++-5-3.3-dev
    Version: 3.3.4-9

    (note: seems to appear also with the 3.3.4-6sarge1 version... but needs
    to be verified.)

    This problem was reported a couple of times on the web... It also seems
    to have been fixed (#260581) in some older version of the package.

    I want to compile a library using the static version of the libstdc++.
    For example this small program:

    #include <iostream>
    void
    test()
    {
    std::cout << "foobar\n";
    }


    Then, I try to compile it like this:

    mathieu@c-l-175:~$ g++ -shared foobar.cpp -o foobar.so -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lc
    /usr/bin/ld: foobar.so: undefined versioned symbol name std::time_put_w@@GLIBCPP_3.2
    /usr/bin/ld: failed to set dynamic section sizes: Bad value
    collect2: ld returned 1 exit status


    The thing is that with the new g++-3.4, using the libstdc++6, everything seems to work.
    So I decided to look a little bit more deeply in these 2 different version of libstdc++.a: One interesting thing is that in the 3.4 version, no symbols @@GLIBCPP_3.2
    appears. Maybe this is the solution for 3.3 ?

    One other thing: this problem seems to be related to the bug #12595 of the gcc bugzilla.
    Maybe it can help.

    Before I forget: I'm running a complete unstable system
    kernel: 2.6.7 self compiled

    mathieu@c-l-175:~$ dpkg -l | grep libstdc++
    ii libstdc++2.10- 2.95.4-22 The GNU stdc++ library (development files)
    ii libstdc++2.10- 2.95.4-22 The GNU stdc++ library
    ii libstdc++5 3.3.4-9 The GNU Standard C++ Library v3
    ii libstdc++5-3.3 3.3.4-9 The GNU Standard C++ Library v3 (development ii libstdc++5-dev 3.2.3-9 The GNU Standard C++ Library v3 (development ii libstdc++5-doc 3.2.3-9 The GNU Standard C++ Library v3 (documentati ii libstdc++6 3.4.1-5 The GNU Standard C++ Library v3
    ii libstdc++6-dev 3.4.1-5 The GNU Standard C++ Library v3 (development

    mathieu@c-l-175:~$ dpkg -l | grep g++
    ii g++ 3.3.4-2 The GNU C++ compiler
    ii g++-2.95 2.95.4-22 The GNU C++ compiler
    ii g++-3.2 3.2.3-9 The GNU C++ compiler
    ii g++-3.3 3.3.4-9 The GNU C++ compiler
    ii g++-3.4 3.4.1-5 The GNU C++ compiler


    Best Regards,
    Mathieu Fluhr




    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)