libstdc: no such file or directory
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > libstdc: no such file or directory




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    libstdc: no such file or directory  
Doctor Bones


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-21-04 10:56 PM

PLease help.  I have a decent amount of C++ experience on Windows, but
know nothing about Unix.  I wrote a simple "Hello World" program on a
Solaris box which includes <iostream>.  The program compiles when I
run g++ but when I attempt to execute a.out I get the following error:

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


Can someone tell me what I need to do to configure my environment?





[ Post a follow-up to this message ]



    Re: libstdc: no such file or directory  
Nils O. Selåsdal


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-21-04 10:56 PM

On Thu, 21 Oct 2004 12:42:36 -0700, Doctor Bones wrote:

> PLease help.  I have a decent amount of C++ experience on Windows, but
> know nothing about Unix.  I wrote a simple "Hello World" program on a
> Solaris box which includes <iostream>.  The program compiles when I
> run g++ but when I attempt to execute a.out I get the following error:
>
> ld.so.1: ./a.out: fatal: libstdc++.so.5: open failed: No such file or
> directory
> Killed
>
>
> Can someone tell me what I need to do to configure my environment?
Looks like it cannot find your libstdc++
You can execute it but
LD_LIBRARY_PATH=/path/where/libstdc++is/ ./a.out
Or make the runtime linker search there by adding command line flags to
the linking stage:
-Wl,-R,/path/where/libstdc++is/





[ Post a follow-up to this message ]



    Re: libstdc: no such file or directory  
Bjorn Reese


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-22-04 12:49 PM

On Thu, 21 Oct 2004 12:42:36 -0700, Doctor Bones wrote:

> PLease help.  I have a decent amount of C++ experience on Windows, but
> know nothing about Unix.  I wrote a simple "Hello World" program on a
> Solaris box which includes <iostream>.  The program compiles when I
> run g++ but when I attempt to execute a.out I get the following error:
>
> ld.so.1: ./a.out: fatal: libstdc++.so.5: open failed: No such file or
> directory

g++ keeps its iostream implementation in the library libstdc++.so.
A .so (shared object) file is like a dll file.

The problem is that g++, or more correctly its libstdc++.so library
is not installed into any of the default system library directories
and the program loader cannot find it. This is the error message
you are seing. The command "ldd a.out" also tells you that it cannot
find the path for the library.

You have three options.

1. You can get your system administrator to install g++ and its
header files and libraries on the system.

2. You can set the LD_LIBRARY_PATH environment variable to include
the path to where your libstdc++.so library is currently located.
Chances are that it is located in the same directory as libgcc,
which can be found with "g++ -print-libgcc-file-name".

3. Instead of linking with the shared version (the dll) of the
library, you can link with the static version. This means that
all the necessary library code is put directly into your program.
So the program will grow in size, but it will not have external
dependencies. This is done by adding the "-static" compiler option
when you compile with g++.

--
mail1dotstofanetdotdk






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:49 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register