Re: Is this bug in g++ /gcc-3.4.0 ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



yuki shimada <epsoft@xxxxxxxxxxxxxx> writes:

> Hollo!
> I am Yuki Shimada.
> This time , I had installed gcc-3.4.0 into my RedHat9.
> And then,I had compiled "hello.cc" by using "g++". But cannot excute
> "./a.out".   Compiler tells me a error.
> (Incase of "hellp.c" complied by "gcc", "./a.out" can excute well.)
> 
> #1 error from g++
> [yuki@localhost c++]$ g++ hello.cc
> [yuki@localhost c++]$ ./a.out
> ./a.out: error while loading shared libraries: libstdc++.so.6: cannot
> open shared object file: No such file or directory

You need to tell your linker-loader where to find libstdc++.so.6
. Use 'man ld.so' to read about the linker-loader.

By default, gcc will install libstdc++.so.6 into /usr/local/lib . If
    you configured gcc with --prefix, it  will be in $prefix/local/lib
    . If you don't know where libstdc++.so.6 is,

    $ find / -iname 'libstdc++.so.6' -print

    will tell you where it is.

Once you know where libstdc++.so.6 is, you can use ldconfig or
    LD_LIBRARY_PATH to tell the linker-loader where it is. Use 'man
    ldconfig' and 'man ld.so.conf' to read about ldconfig . Usually:

    # echo /usr/local/lib >> /etc/ld.so.conf
    # ldconfig

    (run as root)

    is correct. If libstdc++.so.6 is not in /usr/local/lib, replace
    '/usr/local/lib' with the directory containing libstdc++.so.6 .

To use LD_LIBRARY_PATH, set it as an environment variable:

    in bash:
    $ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

    in csh:
    > setenv LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH

    Again, if libstdc++.so.6 is not in /usr/local/lib, replace it
    with the directory containing libstdc++.so.6 .
    

> #2 my source code: see attachment of this mail.

> Is this a bug ?

It's not a bug. Thank you for providing more information.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux