Click to See Complete Forum and Search --> : Aarrggghhh!!


DummyMike
08-21-2002, 01:58 PM
Somebody please help me!
I can not get a simple "Hello world!" program to run!

I can compile it fine, no errors, no warnings. But when I try to run it, I just get an error message that says "hello.exe: command not found", but it is there, I made sure execute permissions were set...still nada.
Here's the source:

#Include <stdio.h>
void main(){
printf("Hello World!");
}

I compiled using this command line:
gcc hello.c -o hello.exe

Both the hello.c and hello.exe are in a directory somewhere under the users home dir... eg:" /home/me/mystuff/hello.exe", and I am trying to run it while located in the directory.

Are there other permissions that need to be set?
Can binary executables only be in directories listed in the PATH enviroment variable? What gives?

I'm too new at linux, and i'm ready to rip whats left of my hair out of my skull.

dfx
08-21-2002, 02:05 PM
Just typing a command name will make the shell search for the command in your PATH. If you don't have your current dir (.) in your path, the command won't be found. Try running ./hello.exe instead. You can also add . to your PATH.

PS: The .exe extension is windosish, don't use it ;)

DummyMike
08-21-2002, 02:40 PM
Thank you. Thank you. Thank you.
..and the ".exe" will be dropped..just have it for "transition ease" for now...:rolleyes: