Professional Web Applications Themes

ld: fatal: file a.out; open failed: Permission denied - UNIX Programming

I try to compile a program with gcc prog.c and i get the error above. This only happens when i am compiling it as a user, if i compile it as root i have no problems. The only thing i have to do as root is to pass the appropriate path to the make file and the gcc file, if i use make. I get ofcourse the same error running make. I tried to change the permissions on ld but to no avail. Any ideas for what i am doing incorrectly or what i need to set up ?...

  1. #1

    Default ld: fatal: file a.out; open failed: Permission denied

    I try to compile a program with gcc prog.c and i get the error above.
    This only happens when i am compiling it as a user, if i compile it as
    root i have no problems. The only thing i have to do as root is to
    pass the appropriate path to the make file and the gcc file, if i use
    make. I get ofcourse the same error running make. I tried to change
    the permissions on ld but to no avail. Any ideas for what i am doing
    incorrectly or what i need to set up ?
    joao Guest

  2. #2

    Default Re: ld: fatal: file a.out; open failed: Permission denied

    joao coelho <pt> wrote: 

    It looks as if you do not have the permission to write to the
    directory where the linker would put the executable. Either
    tell the linker to write the file somewhere else (use the
    '-o' option followed by the full path for the executable, e.g
    "-o /home/joao/a.out") or become root and then give your normal
    account write permissions to that directory.

    Regards, Jens
    --
    \ Jens Thoms Toerring ___ fu-berlin.de
    \__________________________ http://www.toerring.de
    Jens.Toerring@physik.fu-berlin.de Guest

  3. #3

    Default Re: ld: fatal: file a.out; open failed: Permission denied

    > It looks as if you do not have the permission to write to the 
    That's exactly what happened. When i created the directory i was root.
    joao Guest

Similar Threads

  1. how to open a file with 666 permission
    By Arjun in forum PERL Beginners
    Replies: 14
    Last Post: September 30th, 12:24 PM
  2. Replies: 4
    Last Post: August 10th, 08:17 PM
  3. Can't do setuid and file permission denied
    By Chris in forum PERL Beginners
    Replies: 0
    Last Post: October 29th, 01:41 AM
  4. Replies: 3
    Last Post: August 15th, 06:26 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139