# Linux exec not running

I just reinstalled Suse Linux 10.0 with GNome interface. I tried to test c++ with a hello world application. I compiled it like this

Code:
g++ -o hello hello.cpp
Although the compiler built the executable file, when I tried to run it from the shell using exec, it said

Code:
bash:exec:hello: hello not found
What's the problem?

Thank you for the help

Related Programming and Computer Science News on Phys.org
just try
./hello
or whatever the filename is
--shawn

sid_galt said:
I just reinstalled Suse Linux 10.0 with GNome interface. I tried to test c++ with a hello world application. I compiled it like this
Code:
g++ -o hello hello.cpp
Although the compiler built the executable file, when I tried to run it from the shell using exec, it said
Code:
bash:exec:hello: hello not found
What's the problem?
Thank you for the help
a.out is the output. you can rename it what ever you like, but immediately after compilation, it is called a.out... you might have to do a ./a.out if you do not have "the current directory" in your search path.

ComputerGeek said:
a.out is the output. you can rename it what ever you like, but immediately after compilation, it is called a.out... you might have to do a ./a.out if you do not have "the current directory" in your search path.

Normally you would be right, but not in this case. He used the '-o' flag which changed the output filename to 'hello'.

As for why this is not working, are you sure it compiled correctly? Did you check to make sure that a file called 'hello' was in fact created? Because the output is telling you that that file is not there.

Last edited: