Find the answer to your Linux question:
Results 1 to 7 of 7
I'm trying to run my (finally :P ) compiled code and it's giving me this: bash: ./main: Permission denied please help...
  1. #1
    Just Joined!
    Join Date
    Feb 2010
    Posts
    5

    can't run compiled code

    I'm trying to run my (finally :P ) compiled code and it's giving me this:


    bash: ./main: Permission denied

    please help

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    you need to set execute bit, chmod +x main

  3. #3
    Just Joined!
    Join Date
    Feb 2010
    Posts
    5
    OK now it gives

    bash: ./main: cannot execute binary file

  4. #4
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    how did you compile it? if you used a makefile, post it

  5. #5
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,114
    bash: ./main: cannot execute binary file
    This means it isn't a valid executable file. There are lots
    of reasons this might happen. Tell us more about your source
    code, and how you compiled it.

  6. #6
    Just Joined!
    Join Date
    Feb 2010
    Posts
    5

    Wink

    gah! it ended up being a linking problem
    it compiles and links and runs now tyvm!

  7. #7
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,975

    I know the feeling! One of those Homer Simpson moments... Glad you got it sorted out.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...