-
How to run executable?
I'm on a UNIX system and have compiled my first program called "hello world". I named the binary code helloWorld and get a file called helloWorld*. When I try to run it I get this message:
ld.so.1: helloWorld: fatal: libstdc++.so.2.10.0: open failed: No such file or directory Killed
The code compiled just fine; I used and 7-line example right out of a book, what gives?
-
Were you using gcc? If so, tell us the exact syntax you used to compile it. I know gcc has a lot of flags and exceptions and you might have either compiled it to object code or some other type of format. I mess up UNIX flags all the time.
-
are you running it with the full path statement? If not... does your PATH statement reflect running binaries from the directory you are in...?
-
biosx -
I'm using the 'c++' compiler on my system; this is the exact syntax,
% c++ helloWorld.c -o helloWorld
And again, it seems to create a binary executable in the /bin directory that looks like 'helloWorld*'.
Betazap -
Since I haven't explicitly stated any thing that resembles a 'path statement', I'm probably not running a full path statement, but just to be clear below is the source code.
/****************************************
Description:
A small C++ program that says 'Hello, world!'
****************************************/
// Various include files
#include <iostream.h>
int main ()
{
std::cout << "Hello, world!" << std::endl;
return 0;
}
PS I don't think this should make a difference, but I'm on a Win2000 PC logged into a Sun Enterprise machine thru a telnet session, everything I'm doing is in the command line environment of UNIX to include the editor (vi).
Cheers, Hugo
-
>PS I don't think this should make a difference, but I'm on a >Win2000 PC logged into a Sun Enterprise machine thru a telnet >session, everything I'm doing is in the command line >environment of UNIX to include the editor (vi).
No, this shouldn't make a difference. The build environment is your Sun machine. That's the environment where compiling and linking is done.
I could compile the source-code, used gpp. That's not the problem. The problem is linking
>ld.so.1:
If I am correct, ld is the linker. So this process encounters a fatal error and is being killed. And it seems that it cannot open a binary file called libstdc++.so.2.10.0 (?).
-
Check to see if there is a library called libstdc++.so.2.10.0 in /usr/lib or /usr/local/lib /lib and maybe a few other places. libstdc++.so usually is a soft link to the real library file, so make sure that libstdc++.so points to a valid file. You might also want to try a compile with g++.