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
Click For Summary

Discussion Overview

The discussion revolves around an error encountered when attempting to execute a C++ program on Suse Linux 10.0. Participants explore potential reasons for the "bash: exec: hello: hello not found" message after compiling a simple hello world application.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes compiling a C++ program using the command g++ -o hello hello.cpp but encounters an error when trying to run it.
  • Another participant suggests using ./hello to execute the program, implying that the current directory may not be in the search path.
  • A different participant reiterates the compilation process and notes that the default output file is a.out, but acknowledges that the -o flag changes the output to hello.
  • Concerns are raised about whether the file hello was actually created and whether the compilation was successful, questioning the presence of the executable file.

Areas of Agreement / Disagreement

Participants express differing views on the execution method and the implications of the compilation command. There is no consensus on the root cause of the error, as some focus on execution methods while others question the compilation outcome.

Contextual Notes

There are unresolved assumptions regarding the compilation success and the configuration of the system's search path for executables.

sid_galt
Messages
503
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:

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 8 ·
Replies
8
Views
6K
  • · Replies 12 ·
Replies
12
Views
7K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 3 ·
Replies
3
Views
7K
  • · Replies 5 ·
Replies
5
Views
4K