Permissions Denied problem

Discussion in 'Mac Programming' started by ArxFatalis, Oct 20, 2012.

  1. macrumors newbie

    Joined:
    Oct 20, 2012
    #1
    Hi there!
    I started to learn C. When i compile some programs from K&R C programming language via gcc -c something.c -o something.app, it is ok. But when I'm trying to run it via open ./something app it shows me permission denied. Is there some solution to fix this?
    Thanks!
    P.S. Im noob in terminal so it may be my error.
    P.S.S. Excuse me for my bad English
     
  2. macrumors 65816

    Dweez

    Joined:
    Jun 13, 2011
    Location:
    Down by the river
    #2
    Do an "ls -l something.app" and post the results.
     
  3. thread starter macrumors newbie

    Joined:
    Oct 20, 2012
    #3
    -rw-r--r-- 1 myaccount staff 184 20 oct 17:27 testc.app
     
  4. thread starter macrumors newbie

    Joined:
    Oct 20, 2012
    #4
    And also, can you run console apps that was built by Xcode?
     
  5. macrumors 6502a

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #5
    The '-c' parameter only compiles the .c file into an object file. Not something you can execute. It's intended for .c files that don't contain a main() function. Does that file contain a main() function? If so, you shouldn't be using the '-c' parameter.

    Just:

    gcc something.c -o something.app
    ./something.app
     
  6. thread starter macrumors newbie

    Joined:
    Oct 20, 2012

Share This Page