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

  • Thread starter Thread starter sid_galt
  • Start date Start date
  • Tags Tags
    Linux Running
AI Thread Summary
The discussion revolves around an issue encountered while trying to run a C++ program on Suse Linux 10.0 with the GNome interface. After compiling a simple "Hello World" application using the command "g++ -o hello hello.cpp," the user received an error message stating "bash: exec: hello: hello not found" when attempting to execute the program. The solution provided emphasizes the need to run the program with "./hello" to specify the current directory, as executables in the current directory may not be in the shell's search path. Additionally, there is a reminder to verify that the executable file named 'hello' was indeed created during compilation, as the error suggests it may not exist.
sid_galt
Messages
502
Reaction score
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
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:
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Replies
2
Views
769
Replies
1
Views
4K
Replies
1
Views
4K
Replies
1
Views
3K
Replies
9
Views
3K
Replies
8
Views
6K
Replies
12
Views
7K
Back
Top