public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Help me solve this error:  fatal: libstdc++.so.5: No such file or directory !!
@ 2004-09-10 22:55 tran trung dung~
  2004-09-14  1:50 ` James E Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: tran trung dung~ @ 2004-09-10 22:55 UTC (permalink / raw)
  To: gcc

I compile a program using STL on GNU environment and
the result like:
> g++ ir1.c
> a.out
ld.so.1: a.out: fatal: libstdc++.so.5: open failed: No
such file or directory
Killed
> g++ -o ir1 ir1.c
> ldd ir1
        libstdc++.so.5 =>        (file not found)
        libm.so.1 =>     /usr/lib/libm.so.1
        libgcc_s.so.1 =>         (file not found)
        libc.so.1 =>     /usr/lib/libc.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
       
/usr/platform/SUNW,Sun-Fire-880/lib/libc_psr.so.1

Please help me to overcome this problem
Thanks
TTDUNG


		
_______________________________
Do you Yahoo!?
Shop for Back-to-School deals on Yahoo! Shopping.
http://shopping.yahoo.com/backtoschool

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Help me solve this error:  fatal: libstdc++.so.5: No such file or directory !!
  2004-09-10 22:55 Help me solve this error: fatal: libstdc++.so.5: No such file or directory !! tran trung dung~
@ 2004-09-14  1:50 ` James E Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: James E Wilson @ 2004-09-14  1:50 UTC (permalink / raw)
  To: tran trung dung~; +Cc: gcc

tran trung dung~ wrote:
> ld.so.1: a.out: fatal: libstdc++.so.5: open failed: No
> such file or directory

This is how shared libraries work.  There are multiple ways to address this.
1) Use the configure option --disable-shared, so that you don't have to 
worry about how shared libraries work.
2) Put the directory with the gcc libraries in the environment variable 
LD_LIBRARY_PATH so that they will be found by the dynamic linker.  This 
environment variable name may change from OS to OS, and some have more 
than one, e.g. one for 32-bit libraries and one for 64-bit libraries. 
See the OS documentation.  See also the linker (ld) and dynamic linker 
(ld.so) documentation.
3) Modify the dynamic linker configuation files to include the gcc 
library install directory on the search path.  This is sometimes the 
file /etc/ld.so.con and the program ldconfig.  See the OS documentation.
4) Use the linker option -R or -rpath option to hard code the gcc 
library install directory into the binaries, so they can be found at run 
time.  This assumes the directories will always be in the same place on 
all machines where this program will be run.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-14  1:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-10 22:55 Help me solve this error: fatal: libstdc++.so.5: No such file or directory !! tran trung dung~
2004-09-14  1:50 ` James E Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).