Solving "bash:exec:hello: hello not found" Error on Suse Linux 10.0

In summary, the conversation discusses an issue with running a compiled C++ program on Suse Linux 10.0 with GNome interface. The speaker encountered an error message when trying to run the program from the shell. Suggestions were given to rename the output file and to check if the program was compiled correctly.
  • #1
sid_galt
502
1
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
 
Technology news on Phys.org
  • #2
just try
./hello
or whatever the filename is
--shawn
 
  • #3
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.
 
  • #4
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:

What causes the "bash:exec:hello: hello not found" error on Suse Linux 10.0?

This error is typically caused by a missing or incorrect path for the "hello" program. This can happen if the program is not installed or if the path to the program is not correctly specified in the command.

How can I fix the "bash:exec:hello: hello not found" error?

To fix this error, you can try reinstalling the "hello" program or making sure that the correct path to the program is specified in the command. You may also need to check your system's environment variables to ensure they are correctly set up.

Can I use a different program to replace "hello" in my command?

Yes, you can use any program that serves the same purpose as "hello" in your command. Just make sure to specify the correct path to the program and any necessary arguments in your command.

Is there a way to prevent this error from happening in the future?

To prevent this error, it's important to make sure that all necessary programs are properly installed and that their paths are correctly specified in commands. You may also want to consider using a package manager to manage your programs and their dependencies.

What should I do if I continue to get the "bash:exec:hello: hello not found" error after trying to fix it?

If the error persists, it could indicate a larger issue with your system's configuration or environment variables. In this case, it may be helpful to seek assistance from a Linux expert or consult online resources for troubleshooting steps.

Similar threads

  • Programming and Computer Science
Replies
1
Views
3K
  • Programming and Computer Science
Replies
1
Views
3K
  • Programming and Computer Science
Replies
1
Views
3K
  • Programming and Computer Science
Replies
9
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Programming and Computer Science
Replies
3
Views
4K
Replies
16
Views
2K
  • Programming and Computer Science
Replies
12
Views
6K
  • Programming and Computer Science
Replies
8
Views
5K
Back
Top