Page 1 of 1

In PATH but compiled prog not running

PostPosted: Fri Dec 28, 2001 5:56 am
by dingus
Hi
I'm new to Darwin and compiling. To learn a bit I'm reading a C in 21 Days book. I wrote out the source and got it to compile without an error. When the program is in the /usr/local/bin directory, it runs without a hitch. But when I put it in the ~/bin directory (my home base), I get a "command not found" error. I checked the PATH variable, and ~/bin is among the directories listed, so I'd think when I type in the program name (multiply, in this case) it would run. Since it won't I'm puzzled. I did have to create a ~/bin directory (it's apparently not part of 10.1), which is visible in the Finder, but I set the permissions to allow for execution. I suspect what I'm overlooking is supersimple. Can anyone tell me what to do to get the program to run in ~/bin?
Jon

Re: In PATH but compiled prog not running

PostPosted: Sat Dec 29, 2001 1:27 am
by apex
Why are you trying to run it from ~/bin/? that is a very very odd place to run a binary from. /usr/local/bin/ or /usr/bin/ is the place you should be running it from.

Re: In PATH but compiled prog not running

PostPosted: Tue Jan 01, 2002 8:40 am
by forty_two
Originally posted by dingus:
Hi
Can anyone tell me what to do to get the program to run in ~/bin?
Jon


You have to add ~/bin to your search path for binaries. Be advised, though, that this is a nonstandard place for binaries. As apex mentioned you might be better off putting it somewhere that's already in the search path.

Hope that helps.

Re: In PATH but compiled prog not running

PostPosted: Wed Jan 02, 2002 2:08 pm
by orange1
echo $PATH
if ~/bin is indeed there, then move your binary there. then open a new terminal window and give it a try. usually when i install something new, it won't find my new binary until i get in a new terminal.