Missing libstdc++ on linux

This is a discussion on Missing libstdc++ on linux within the C++ Programming forums, part of the General Programming Boards category; This may not specifically be a C++ issue, but it is related, and I think some of the posters to ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    2

    Missing libstdc++ on linux

    This may not specifically be a C++ issue, but it is related, and I
    think some of the posters to this site would know as much about this issue as
    anyone...

    I recently installed libstdc++6-4.0.1-5mdk.i586.rpm because an
    application (I think it was Cinelerra) complained that it needed a
    newer version than I had.
    Now, when I try to compile any C++ program with g++, ld gives me the
    following error:
    /usr/bin/ld: cannot find -lstdc++

    My /usr/lib directory now contains
    libstdc++.so.5@
    libstdc++.so.5.0.6
    libstdc++.so.6@
    libstdc++.so.6.0.5

    but no other libstdc++ files are anywhere on my system. I don't know
    what was there before I installed the new package (foolish me). I
    assume I am missing a libstdc++.a file, and the rpm I installed
    claimed to provide libstdc++ as well as the .so, but it didn't put it
    on my system.

    How do I get libstdc++.a back (if that is in fact the problem)?
    I'm running Mandrake 10.1

    Any help would be greatly appreciated.

  2. #2
    Registered User
    Join Date
    Aug 2002
    Location
    Hermosa Beach, CA
    Posts
    446
    Isn't the .so file enough? I thought gcc only links against .a files if they are the only thing there, or if you explicitly ask for a static link with something like "gcc -static ...". Maybe you need something like "-L/usr/lib" on your compile line, so that it knows where to look?

    Anyway if it makes you feel better, there are no .a files on my machine, only .so files. So maybe that's all you get anyway.
    This was on a Fedora Core 1 or 2 (forget which).

    /usr/lib/libstdc++.so.5
    /usr/lib/libstdc++.so.5.0.5
    The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.

  3. #3
    Registered User
    Join Date
    Nov 2005
    Posts
    2

    Smile

    Thanks for the reply. You're right - the .so is all that's needed. I tried creating a link named libstdc++.so that points to libstdc++.so.6.0.5 and now it works.
    I had thought that you needed a -non-static switch to use shared libraries, but I guess that's the default. The installation of the new version must have removed an existing link.

    Thanks again - your mentioning that the .a file should not be needed is what led me to try the link to the .so.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Wireless Network Linux & C Testbed
    By james457 in forum Networking/Device Communication
    Replies: 3
    Last Post: 06-11-2009, 11:03 AM
  2. installing linux for the first time
    By Micko in forum Tech Board
    Replies: 9
    Last Post: 12-06-2004, 04:15 AM
  3. Linux for Windows!
    By Strut in forum Linux Programming
    Replies: 2
    Last Post: 12-25-2002, 10:36 AM
  4. Linux? Windows Xp?
    By VooDoo in forum Linux Programming
    Replies: 15
    Last Post: 07-31-2002, 08:18 AM
  5. linux vs linux?
    By Dreamerv3 in forum Linux Programming
    Replies: 5
    Last Post: 01-22-2002, 08:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21