开发者

cannot open output file helloWorld.exe: Permission denied

开发者 https://www.devze.com 2023-04-12 06:33 出处:网络
When I try to compile helloWorld.c with gcc (by MinGW) via notepad++\'s run feature I get the error: cannot open output file helloWorld.exe: Permission denied

When I try to compile helloWorld.c with gcc (by MinGW) via notepad++'s run feature I get the error:

cannot open output file helloWorld.exe: Permission denied

The problem only occurs when I run the compiler via notepad++'s run feature, so I get no errors when I just compile it manually via cmd.

As some others have answered on similar questions, I have tried looking in process explorer and helloWorld.exe is not running.

.

Additional details about how I run it in notepad++

I use a batch script compile.bat

gcc -o %1 %2
%1
PAUSE

and run it in notepad++ with the command

"...\compile.bat" $(NAME_PART) $(FILE_NAME)

What could be causing this error? Help would be deeply appreciated.

开发者_Go百科

EDIT: Turns out it was a problem with notepad++ that it didn't display that it was working in it's own directory. Also what caused a problem when I had tried to put the directory in the batch file was that it couldn't handle scandinavian letters.


I suspect that notepad is trying to create the output file in it's own directory (ie somewhere in c:\program files\notepad++" that you don't have write permission to.

Is there a "working directory" setting in notepad++'s run command?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号