This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ld.so.1: ./a.out: fatal: libstdc++.so.4: open failed: No such file or directory


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
> directory

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
works.

> 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,

jon


-- 
This space left intentionally blank.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]