Thread: How to solve the problem:cannot open Debug/dm.exe for writing

  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    50

    How to solve the problem:cannot open Debug/dm.exe for writing

    When I compile the project,it also display:cannot open Debug/dm.exe for writing,but in the task manager I don't find the process dm.exe,so I cann't end the process.How to solve this problem?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Does the file exist in that directory?
    Is it read-only perhaps?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I assume this is for MSVS. Close MSVS. If it won't close then go to Task Manager and view processes. End the devenv.exe process. Now open MSVS back up and it should compile. What happens in multi-threaded builds is one or more threads locks the exe file and never unlock it when they finish. This is a known bug in 2008 and although SP1 claimed to fix it I still ran into it frequently. I have not encountered this in MSVS 2010 so perhaps they actually fixed it in that version.

    In MSVS 2005 you could disable threaded builds which was handy b/c 2005 was the first to offer this and it was very buggy as well. I'm not sure if you can turn this off or limit the number of independent compiler threads in 2008.

  4. #4
    Registered User
    Join Date
    Jun 2011
    Posts
    50
    I use VC6,you mean it is bug?

  5. #5
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    VC6 should not have this problem since it does not support multi-threaded compilation and linking. Ensure the file is not marked read only. If you have submitted the exe to source control it will mark it as read-only. You shouldn't be submitting binaries to source control in the first place but thought I would mention it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. cannot open Debug/c.exe for writing
    By juice in forum Windows Programming
    Replies: 9
    Last Post: 01-06-2012, 11:48 AM
  2. Replies: 2
    Last Post: 07-25-2010, 11:45 AM
  3. Good practice of writing debug print statements
    By hzmonte in forum C Programming
    Replies: 11
    Last Post: 11-09-2005, 11:55 PM
  4. Cannot open debug/filename.exe for writing
    By Shadow12345 in forum C++ Programming
    Replies: 2
    Last Post: 08-26-2002, 10:44 AM
  5. Writing to the Debug window ~ VC++
    By Okiesmokie in forum C++ Programming
    Replies: 5
    Last Post: 05-10-2002, 08:50 AM