Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cossie

macrumors member
Original poster
Aug 8, 2006
74
0
Morning,

I'm trying to compile and run some source code in Terminal. It compiles fine using the command

Code:
gcc -c -I /home/cossie/ode/include tutorial.cpp -o tutorial

And I've tried to run the compiled file at the following attempts:

Code:
./tutorial

-bash: ./tutorial: Permission denied

Code:
sudo ./tutorial

Password:

sudo: ./tutorial: command not found

Can anyone give me any pointers as to what I'm doing wrong? I thought ./ was the way to execute an object file in a Unix environment.

Thanks,

Cossie
 

Palad1

macrumors 6502a
Feb 24, 2004
647
0
London, UK
tutorial is missing the exec flag for the current user

Code:
chmod u+x tutorial

more info :
Code:
man chmod
 

cossie

macrumors member
Original poster
Aug 8, 2006
74
0
Palad1 thanks a million! I had totally forgotten about setting the permissions!

I had been using a college account where I had a script running my compiles - which set the permissions - but I can't log into it today, eugh I'm such a muppet!

Thanks again!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.