In PATH but compiled prog not running

dingus

2001-12-28 05:56:00

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

apex

2001-12-29 01:27:00

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.

forty_two

2002-01-01 08:40:00

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.

orange1

2002-01-02 14:08:00

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.