Tiny Core Linux
General TC => General TC Talk => Topic started by: Tuftec on June 05, 2011, 06:30:49 PM
-
Hi All,
I have not written any C code in over 25 years and I am now trying to get back into it.
I have written a small program using geany and I do not seem to get it to run.
My program is very simple. It just accesses a couple of ports on a custom computer board.
It is named gpiotest.
After finding all the library support/include files (I believe so anyway), I have managed to get my program to compile without errors. It appears to link ok and produce an executable that has x permissions set.
When I try to run it (by just typing it's name within the Terminal) it gives an error like this
sh: gpiotest: not found
What have I done wrong? What am I missing? Maybe some sort of link option problem under geany?
Not sure.
Help required please.
Peter.
-
Hi Tuftec
This trips up almost everyone. Try ./gpiotest
-
Thanks Rich. That works.
Things have changed from Unix Version 7.
;D ;D ;D
Whay can I not just type the name?
Peter.
-
Hi Tuftec
It's a Linux thing. Unlike DOS, the fact that it's in the current directory is not enough, it has to be in the
path, or in this case you specified the path as the current directory using ./
-
Right.
Thanks.
-
You can always add the current directory ( . ) to your PATH, but I seem to recall that's considered bad form in some circles for some security-related reason that was never quire clear to me.
-
Or you could just symlink it into a dir which is in $PATH.