Problem getting my C program to run
I am having problems getting my C program to run it compiles OK but when I try to run it from a terminal I get an error command not found here is some output
linux-dhj2:/usr/lib/cprogs # cat helloworld.c #include <stdio.h> main() { printf("hello world\n"); } linux-dhj2:/usr/lib/cprogs # gcc -o helloworld helloworld.c linux-dhj2:/usr/lib/cprogs # chmod 744 helloworld linux-dhj2:/usr/lib/cprogs # helloworld If 'helloworld' is not a typo you can use command-not-found to lookup the package that contains it, like this: cnf helloworld linux-dhj2:/usr/lib/cprogs # I know C programming fairly well having worked on a comercial mfc C++ project (mfc sucks) what am I doing wrong |
In Linux, your current directory is normally not in your path. Many people believe there are important safety benefits from not having the current directory in the path.
So you need to type Code:
./helloworld |
Hi!
Try this one! Code:
./helloworld Regards, Heraton |
Thanks that helped.
|
All times are GMT -5. The time now is 05:57 PM. |