Author Topic: Problem with file.exe, open and hidden-Cannot open output file Permission denied  (Read 436 times)

Offline atilappl

  • Single posting newcomer
  • *
  • Posts: 2
I am using Code Blocks 16.01 and my OS is Windows 10.
Whenever i build a code (named ''crypto.c'', for example) and execute it, the next time i try to build it i get the following error:

" ld.exe Cannot open output file C:\Users\...\crypto.exe Permission denied
error: ld returned 1 exit status
Build failed: 2 error(s), 0 warning(s)"

I looked on topics with similar problems, but i coudn't figured out how to fix this problem yet.
Also, when i try delete the crypto.exe i receive the message:
"The action can't be completed because the file is open in crypto.exe
Close the file and try again"

I believe this error is due to a hidden instance of the .exe opened somewhere, but i couldn't  find it using the task manager.
How can i find and close this hidden instance of the program?

___________________________________________________________________________________________

I found out there's a process with the same name as the .exe opened when i used the Process Explorer from sysinternals, but when i try to kill the process i receive the message:
"Error opening process: Acess is denied"

Then i tried to terminate the process with de command prompt, but then i received the message:
"ERROR: The process "crypto.exe" with PID 11144 could not be terminated.
Reason: Acess is denied."
« Last Edit: June 24, 2018, 05:06:33 pm by atilappl »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6320
    • My Best Post
Your problem sounds like anti-virus software has the file open and is scanning it.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline atilappl

  • Single posting newcomer
  • *
  • Posts: 2
Your problem sounds like anti-virus software has the file open and is scanning it.

Tim S.

I restarted my PC, disabled my anti-virus and began testing my codes. The error remains the same.
The idea seems to be right, but might be another software using the file. Is there any way to find what software are doing this?
« Last Edit: June 24, 2018, 05:00:36 pm by atilappl »

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 2028
Does this also happen with a simple hello world program?
Do you use dropbox or any other sync service with your files?
Is the console runner still running in the task manager?
Use always the sys internal process explorer. The windows 10 task manager is crippled to death....
With the process explorer you should also be able to find the blocking process, if th exe is opened by a other program and not hanging by itself: Find->Find handle or dll->type in the name of your application...