none
fatal error C1085: Cannot write precompiled header file

    Question

  • I am having trouble resolving the following error and can not reslove it. Does anyone know how I can resolve the following error.

    1>c:\program files (x86)\microsoft visual studio 8\vc\include\map(41) : fatal error C1085: Cannot write precompiled header file: '.\Win32\Debug/32dpak.pch': Insufficient system resources exist to complete the requested service.

    Tuesday, July 11, 2006 8:50 PM

Answers

All replies

  • Reboot.

     

    Tuesday, July 11, 2006 9:26 PM
    Moderator
  • Kill mspdbsrv.exe using taskmanager?
    Tuesday, July 11, 2006 11:26 PM
    Moderator
  • I'm getting the same problem!!!
    I've tried both suggestions but none of them helped.
    It happens to both VC7 and VC8.

    Any ideas?

    Thanks.
    Monday, July 9, 2007 11:31 PM
  • I have been getting this message consistently for the past week.   I am running automated unattended builds on an HP server Dual Xeon 3.06Ghz processor with 3gb of RAM. 

    VS .NET 2005 SP1
    Large solution with 392 projects (occurs on smaller sub solution with only 82 projects as well).
    Of the 392 projects12 are consistently failing with the error:

    d:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE\atlsimpstr.h(780) : fatal error C1085: Cannot write precompiled header file: 'Release\RedialDirectory.pch': Insufficient system resources exist to complete the requested service.

    d:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE\atlsimpstr.h(409) : fatal error C1085: Cannot write precompiled header file: 'Release\i2050.pch': Insufficient system resources exist to complete the requested service.

    A reboot resolves the issue temporarily but is not a "solution" for a dedicated build/compile server.  Killing mspdbsvr.exe has no effect.

    The server is used for enterprise level builds of multiple products and only those building with VS 2005 are seeing these issues. 

    Monday, July 16, 2007 10:05 PM
  • Could it be a hard-disk-running-out-of-space problem here?
    Tuesday, July 17, 2007 12:39 AM
    Moderator
  • There are sufficient system resources, both Memory, CPU and disk space when the build is running.

    D: has almost 50GB free
    C: has 14GB free

    Tuesday, July 17, 2007 2:29 AM
  • This is starting to look /sound more like a potential "sharing violation". 

    I need to work around this problem in the build of a customer's application (i.e. I need
    to know what to avoid doing in order to avoid triggering this problem).

    Has anyone identified the resource in question or a change in options or in procedure
    /practice that consistently circumvents the problem?

    Thanks.


    Monday, December 10, 2007 11:46 PM
  • We solved this problem (for .Net 2003) four different ways, maybe one will work for you:

     

    1. Decrease the number of #includes in the stdafx.h file. It appears that once the .pch file gets to a certain size this error starts cropping up. It makes your compiles slower, but at least they compile.

     

    2. In the Project Properties, go to the C/C++/Command Line setting and put in "/Zm200". You may have to put a larger or smaller value in (Microsoft recommends anywhere from 10 to 2000, but they say to use it in response to a C1076 error) . Not as reliable as #1.

     

    3. If you are compiling on a network drive (which we do) we found that forcing the pre-compiled header file to a local drive fixes the problem. To do this go to the Project Properties, then C/C++/Precompiled Header and change the "Precompiled Header File" setting to something like "C:\Temp\Project.pch". This has worked every time for us but it's annoying to have to put the .pch on a local drive. We even tried mapping the local drive as though it were a network drive and still had the problem.

     

    4. Switch to .Net 2008 which doesn't appear to have this problem. At least, we haven't run into it yet.

     

    Gary

     

    • Proposed as answer by David_M_C Monday, April 19, 2010 6:19 PM
    Friday, March 28, 2008 1:10 AM
  • I did as Gary stated in #3 and all works fine.  I was building with a network path getting the stated message and putting the pch on the local drive fixed the issue.
    Tuesday, May 12, 2009 6:07 PM
  • I use it on a network drive, 

    a virtual windows xp computer in virtual box

    and I use vs2008 in virtual pc, but the project is on the network driver on host pc, and I got the fatal error c1085...

     

    and after I put the .pch file on my local C driver, every thing is ok! 

    just wonder why can't use .pch file on network driver.



    Thursday, April 22, 2010 11:17 AM
  • I did as Gary stated in #3 and all works fine.  I was building with a network path getting the stated message and putting the pch on the local drive fixed the issue.

    me too

    ;-)


    I love programming. Sorry for my English if it bothers you, since English is not my mother tongue.
    Thursday, April 22, 2010 11:26 AM
  • I am getting it in VS2008. It is extremely annoying to have such an obvious error persist through several compiler releases. It suggests that the compiler is not being tested before release, since out here in the Real World, almost nobody keeps source files on does builds on a local machine, but instead we use network drives mapped to file servers as a regular practice. A properly-tested compiler would not have this error, because it would not do anything that could trigger such an error. I suspect that what is happening (based on my knowledge of kernel drivers) is that someone is doing a massive WriteFile operation, and when the insufficient system resources message comes back, instead of breaking it down into a series of shorter write operations, they are just reporting the error. This could only occur if (a) the compiler was not tested in real environments and (b) the obvious error recovery code was not written. It would be nice if released products actually worked. This happens only if they are tested under real-world conditions. Toy projects do not count as "testing". And it is NOT acceptable to say "use of network drives is not supported", because that is an insult to the intelligence of the end users ("We know better than you do that what you are doing is not something we want to support, so we don't") The official documentation on C1085 is meaningless noise and wastes a Web page.
    Friday, November 19, 2010 4:02 AM
  • I am getting it in VS2008. It is extremely annoying to have such an obvious error persist through several compiler releases. It suggests that the compiler is not being tested before release, since out here in the Real World, almost nobody keeps source files on does builds on a local machine, but instead we use network drives mapped to file servers as a regular practice. A properly-tested compiler would not have this error, because it would not do anything that could trigger such an error. I suspect that what is happening (based on my knowledge of kernel drivers) is that someone is doing a massive WriteFile operation, and when the insufficient system resources message comes back, instead of breaking it down into a series of shorter write operations, they are just reporting the error. This could only occur if (a) the compiler was not tested in real environments and (b) the obvious error recovery code was not written. It would be nice if released products actually worked. This happens only if they are tested under real-world conditions. Toy projects do not count as "testing". And it is NOT acceptable to say "use of network drives is not supported", because that is an insult to the intelligence of the end users ("We know better than you do that what you are doing is not something we want to support, so we don't") The official documentation on C1085 is meaningless noise and wastes a Web page.
    Friday, November 19, 2010 4:02 AM
  • I am getting it in VS2008. It is extremely annoying to have such an obvious error persist through several compiler releases. It suggests that the compiler is not being tested before release, since out here in the Real World, almost nobody keeps source files on does builds on a local machine, but instead we use network drives mapped to file servers as a regular practice. A properly-tested compiler would not have this error, because it would not do anything that could trigger such an error. I suspect that what is happening (based on my knowledge of kernel drivers) is that someone is doing a massive WriteFile operation, and when the insufficient system resources message comes back, instead of breaking it down into a series of shorter write operations, they are just reporting the error. This could only occur if (a) the compiler was not tested in real environments and (b) the obvious error recovery code was not written. It would be nice if released products actually worked. This happens only if they are tested under real-world conditions. Toy projects do not count as "testing". And it is NOT acceptable to say "use of network drives is not supported", because that is an insult to the intelligence of the end users ("We know better than you do that what you are doing is not something we want to support, so we don't") The official documentation on C1085 is meaningless noise and wastes a Web page.
    Friday, November 19, 2010 4:02 AM
  • I am getting it in VS2008. It is extremely annoying to have such an obvious error persist through several compiler releases. It suggests that the compiler is not being tested before release, since out here in the Real World, almost nobody keeps source files on does builds on a local machine, but instead we use network drives mapped to file servers as a regular practice. A properly-tested compiler would not have this error, because it would not do anything that could trigger such an error. I suspect that what is happening (based on my knowledge of kernel drivers) is that someone is doing a massive WriteFile operation, and when the insufficient system resources message comes back, instead of breaking it down into a series of shorter write operations, they are just reporting the error. This could only occur if (a) the compiler was not tested in real environments and (b) the obvious error recovery code was not written. It would be nice if released products actually worked. This happens only if they are tested under real-world conditions. Toy projects do not count as "testing". And it is NOT acceptable to say "use of network drives is not supported", because that is an insult to the intelligence of the end users ("We know better than you do that what you are doing is not something we want to support, so we don't") The official documentation on C1085 is meaningless noise and wastes a Web page.
    Friday, November 19, 2010 4:02 AM
  • ... It is extremely annoying to have such an obvious error persist through several compiler releases. (...) It would be nice if released products actually worked. (...) The official documentation on C1085 is meaningless noise and wastes a Web page.

    I agree. I'm getting this in VS2010 too.

    Changing location of the *.pch files to a local drive helped.

     

    Thursday, April 7, 2011 12:50 PM
  • Moving the .pch file to a local directory worked here!

    Friday, February 3, 2012 3:27 PM
  • I'm getting the same problem!!!
    I've tried both suggestions but none of them helped.
    It happens to both VC7 and VC8.

    Any ideas?

    Thanks.

    I had same issue using network drive.
    Monday, March 5, 2012 9:49 PM
  • Brilliant, thanks.  Point 3 Works in VS 2010 too.

    Eddie

    Wednesday, March 26, 2014 9:21 AM