Post New Topic  Post A Reply
my profile | register | search | faq | forum home
  next oldest topic   next newest topic
» MacOSX - forked.net   » General Discussion   » In PATH but compiled prog not running

UBBFriend: Email this page to someone!    
Author Topic: In PATH but compiled prog not running
dingus
Junior Member
Member # 269

posted December 27, 2001 09:56 PM      Profile for dingus     Send New Private Message      Edit/Delete Post  Reply With Quote 
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

Posts: 1 | Registered: Dec 2001  |  IP: Logged
apex
Administrator
Member # 1

posted December 28, 2001 05:27 PM      Profile for apex   Email apex   Send New Private Message      Edit/Delete Post  Reply With Quote 
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.
Posts: 307 | From: Alaska | Registered: Aug 2001  |  IP: Logged
forty_two
Junior Member
Member # 253

posted December 31, 2001 12:40 PM      Profile for forty_two     Send New Private Message      Edit/Delete Post  Reply With Quote 
quote:
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.


Posts: 7 | Registered: Dec 2001  |  IP: Logged
willy wonka
Member
Member # 32

posted January 02, 2002 06:08 AM      Profile for willy wonka   Author's Homepage        Edit/Delete Post  Reply With Quote 
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.

--------------------

--

-willy
"Freedom will henceforth be compulsory." -Random Party Manifesto


Posts: 92 | Registered: Aug 2001  |  IP: Logged

All times are Pacific Time  

Post New Topic  Post A Reply Close Topic    Move Topic    Delete Topic next oldest topic   next newest topic
Hop To:

Contact Us | macosx.forked.net

Powered by Infopop Corporation
Ultimate Bulletin BoardTM 6.1.0.2