Alexander
Alexander

Reputation: 27

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.

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.

Upvotes: 1

Views: 2319

Answers (1)

Martin Beckett
Martin Beckett

Reputation: 96109

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?

Upvotes: 1

Related Questions