This is the mail archive of the
mailing list for the libstdc++ project.
Re: ld.so.1: ./a.out: fatal: libstdc++.so.4: open failed: No such file or directory
- From: Jonathan Wakely <cow at compsoc dot man dot ac dot uk>
- To: Ian dot C dot Stong at mail dot sprint dot com
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Fri, 30 Aug 2002 17:23:16 +0100
- Subject: Re: ld.so.1: ./a.out: fatal: libstdc++.so.4: open failed: No such file or directory
- References: <H00026e415d3dcc5.1030722247.reopmp01@MHS>
On Fri, Aug 30, 2002 at 11:44:07AM -0400, Ian.C.Stong@mail.sprint.com wrote:
> On solaris 2.8 I installed gcc 3.1. GCC works fine and g++ on a file
> doesn't give any errors. But trying to run the compiled program (a.out)
> gives the following error:
> ld.so.1: ./a.out: fatal: libstdc++.so.4: open failed: No such file or
Sounds like you need to set LD_LIBRARY_PATH so that ld finds the
libstdc++ shared library file. This isn't a libstdc++ problem, it's how ld
> The libstdc++.so.4 file does exist as does ld.so.1 so not sure what the
> problem is or how to fix.
It exists, but ld doesn't know how to find it.
for bourne shell:
LD_LIBRARY_PATH=/path/to/shared/libs/; export LD_LIBRARY_PATH
for C shell (eurgh):
setenv LD_LIBRARY_PATH /path/to/shared/libs/
N.B the value of LD_LIBRARY_PATH should be the directory containing the
shared lib, not the path to the lib itself.
Hope that helps,
This space left intentionally blank.