简体   繁体   中英

Writing to file permission denied

I'm using cygwin to compile and windows 10. My question is whenever I try to compile I get an error saying:

/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld: cannot open output file a.exe: Permission denied collect2: error: ld returned 1 exit status

It started when I compiled a program that creates a file and then writes to that file, but I don't know why my computer doesn't allow me to create a file in a program. I have no idea how to fix it so I can write to file. Any help is appreciated.

You probably need to run Cygwin as an administrator.

EDIT

I found this:

Root user/sudo equivalent in Cygwin?

Try the accepted answer. It should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM