Fatal error c1859 непредвиденная ошибка предкомпилированного заголовка

Симптомы

При запуске Microsoft Visual C++ 2008 компилятор для компиляции файлов или построения проекта, появляется следующее сообщение об ошибке:

Неустранимая ошибка C1859: имя файла заголовка Непредвиденная предкомпилированного заголовка, просто запустить компилятор может устранить проблему.

Кроме того эта проблема по-прежнему возникает даже при запуске компилятора снова. Эта проблема возникает при включении параметра компилятора Создавать или использовать предварительно скомпилированный заголовочный файл на компьютере под управлением Windows 7 или Windows Server 2008.

Примечание. Могут возникнуть дополнительные проблемы часто при включении параметра компилятора / analyze .

Причина

При включении параметра Создавать или использовать предварительно скомпилированный заголовочный файл компилятора компилятор требует, что относительный модули и файлы предкомпилированных заголовков не перемещения между компиляциями. Тем не менее функция случайный выбор макета адрес пространства (также известный как ASLR) размещает случайным образом модули в процессе. Таким образом эта ошибка возникает при перемещении модулей в промежутке между компиляциями.

Решение

Сведения об исправлении

Существует исправление от корпорации Майкрософт. Однако данное исправление предназначено для устранения только проблемы, описанной в этой статье. Применяйте данное исправление только в тех системах, которые имеют данную проблему. Это исправление может проходить дополнительное тестирование. Таким образом если вы не подвержены серьезно этой проблеме, рекомендуется дождаться следующего пакета обновления, содержащего это исправление.

Чтобы загрузить это исправление из коллекции кода Microsoft Developer Network (MSDN), посетите следующий веб-узел корпорации Майкрософт:

http://code.msdn.microsoft.com/KB976656

Примечание. Коллекции кода MSDN отображаются языки, для которых доступно исправление. Если в списке язык не отображается, это недоступности страница коллекции кода для этого языка.

Примечание. Если наблюдаются другие проблемы или необходимо устранить неполадки, вам может понадобиться создать отдельный запрос на обслуживание. Стандартная оплата за поддержку будет взиматься только за дополнительные вопросы и проблемы, которые не соответствуют требованиям конкретного исправления. Чтобы получить полный список телефонов поддержки и обслуживания клиентов корпорации Майкрософт или создать отдельный запрос на обслуживание, посетите следующий веб-сайт корпорации Майкрософт:

http://support.microsoft.com/contactus/?ws=supportПримечание. Также можно загрузить исправление с веб-узла корпорации Майкрософт:

https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=25785Примечание. Данное исправление также содержит исправления для «C1001: Внутренняя ошибка компилятора (файл компилятора f:ddvctoolscompilerutcsrcp2main.c, строка 182) при использовании .NET framework 3.5.

Предварительные условия

Microsoft Visual Studio 2008 Пакет обновления 1 для установки этого исправления необходимо иметь.

Необходимость перезагрузки

Необходимо перезагрузить компьютер после установки исправления, если используется не экземпляр Visual Studio.

Сведения о замене исправлений

Это исправление не заменяет других исправлений.

Сведения о файлах


Английская версия данного исправления содержит атрибуты файла (или более поздние атрибуты файлов), приведенные в следующей таблице. Дата и время для этих файлов указаны в формате общего скоординированного времени (UTC). При просмотре сведений о файле, он преобразуется в локальное время. Чтобы узнать разницу между временем по Гринвичу и местным временем, следует использовать
Часовой пояс
вкладке
Дата и время
элемент панели управления.

Имя файла

Версия файла

Размер файла

Дата

Время

C1.dll

15.0.30729.4455

677,184

10-Dec-2009

02:31

C1.dll

15.0.30729.4455

828,744

10-Dec-2009

02:31

C1xx.dll

15.0.30729.4455

2,202,952

10-Dec-2009

02:31

C1xx.dll

15.0.30729.4455

2,213,704

10-Dec-2009

02:31

C1xx.dll

15.0.30729.4455

2,348,360

10-Dec-2009

02:31

C1xx.dll

15.0.30729.4455

2,504,016

10-Dec-2009

02:31

C1xx.dll

15.0.30729.4455

2,890,568

10-Dec-2009

02:31

Временное решение

Чтобы обойти эту проблему, воспользуйтесь одним из следующих методов.

Способ 1

Если он включен, отключите параметр компилятора / analyze .

Способ 2

Запустите построение с нуля.

Способ 3

Перезагрузите компьютер.

Способ 4

Отключите параметр компилятора Создавать или использовать предварительно скомпилированный заголовочный файл .

Примечание. Эти методы не являются гарантированно работать. Даже при использовании одного из этих методов по-прежнему могут возникнуть проблемы.

Статус

Корпорация Майкрософт подтверждает, что это проблема продуктов Майкрософт, перечисленных в разделе «Относится к».

Дополнительные сведения

Дополнительные сведения о случайный выбор макета адрес пространства посетите следующий Microsoft блога:

Адрес места случайный выбор макета в Windows VistaДополнительные сведения о предварительно скомпилированный заголовочный файл ошибок посетите следующий Microsoft блога:

Предкомпилированный заголовок ошибки в Windows 7

Нужна дополнительная помощь?

Нужны дополнительные параметры?

Изучите преимущества подписки, просмотрите учебные курсы, узнайте, как защитить свое устройство и т. д.

В сообществах можно задавать вопросы и отвечать на них, отправлять отзывы и консультироваться с экспертами разных профилей.

Symptoms

When you run the Microsoft Visual C++ 2008 compiler to compile files or to build a project, you receive the following error message:

fatal error C1859: header file name unexpected precompiled header, simply rerunning the compiler might fix this problem.

Additionally, this issue still occurs even when you run the compiler again. This issue occurs when you enable the Create/Use Precompiled Header compiler option on a computer that is running Windows 7 or Windows Server 2008.

Note You may encounter this issue more frequently if you enable the /analyze compiler option.

Cause

When you enable the Create/Use Precompiled Header compiler option, the compiler requires that the precompiled header files and the relative modules do not move between compilations. However, the Address Space Layout Randomization (also known as ASLR) feature randomly relocates modules in a process. Therefore, the error occurs when modules move between compilations.

Resolution

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

To download this hotfix from the Microsoft Developer Network (MSDN) Code Gallery, visit the following Microsoft Web site:

http://code.msdn.microsoft.com/KB976656

Note The MSDN Code Gallery displays the languages for which the hotfix is available. If you do not see your language listed, it is because the Code Gallery resource page is not available for that language.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=supportNote You can also download this hotfix from the following Microsoft Web site:

https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=25785Note This hotfix package also contains a fix for «C1001: An internal error has occurred in the compiler (compiler file f:ddvctoolscompilerutcsrcp2main.c, line 182) when you are using .NET framework 3.5.

Prerequisites

You must have Microsoft Visual Studio 2008 Service Pack 1 installed to apply this hotfix.

Restart requirement

You do not have to restart the computer after you apply the hotfix if no instance of Visual Studio is being used.

Hotfix replacement information

This hotfix does not replace any other hotfixes.

File information


The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the
Time Zone
tab in the
Date and Time
item in Control Panel.

File name

File version

File size

Date

Time

C1.dll

15.0.30729.4455

677,184

10-Dec-2009

02:31

C1.dll

15.0.30729.4455

828,744

10-Dec-2009

02:31

C1xx.dll

15.0.30729.4455

2,202,952

10-Dec-2009

02:31

C1xx.dll

15.0.30729.4455

2,213,704

10-Dec-2009

02:31

C1xx.dll

15.0.30729.4455

2,348,360

10-Dec-2009

02:31

C1xx.dll

15.0.30729.4455

2,504,016

10-Dec-2009

02:31

C1xx.dll

15.0.30729.4455

2,890,568

10-Dec-2009

02:31

Workaround

To work around this problem, use one of the following methods.

Method 1

Disable the /analyze compiler option if it is enabled.

Method 2

Start a clean build.

Method 3

Restart the computer.

Method 4

Disable the Create/Use Precompiled Header compiler option.

Note These methods are not guaranteed to work. Even if you use one of these methods, you may still encounter this issue.

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the «Applies to» section.

More Information

For more information about Address Space Layout Randomization, visit the following Microsoft blog post:

Address Space Layout Randomization in Windows VistaFor more information about Precompiled Header errors, visit the following Microsoft blog post:

Precompiled Header errors in Windows 7

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

I was trying to build a simple solution involving a Windows and a Console application. After using the wizard to generate the code skeleton for the projects, I didn’t add any code and just built the generated code. In both cases I got the same error:

1>c:cwinprwinprwinpr.cpp(4) : fatal error C1859: 'Debugwinpr.pch' unexpected precompiled header error, simply rerunning the compiler might fix this problem

What is wrong, any thoughts?

Dr1Ku's user avatar

Dr1Ku

2,8653 gold badges46 silver badges56 bronze badges

asked Aug 7, 2012 at 21:34

vico's user avatar

2

There is a fix for Visual C++ 2008 SP1 compiler error C1859. You may download it here.

For details see this.

answered Aug 7, 2012 at 21:45

Jacob Seleznev's user avatar

Jacob SeleznevJacob Seleznev

7,9733 gold badges24 silver badges34 bronze badges

7

We had something similar at work all of a sudden, one day. Our problem was down to this

A simple PC restart done it for me anyway.

answered Aug 7, 2012 at 21:39

Science_Fiction's user avatar

0

The link provided in the answer above is no longer available.

I was getting the same error and in my case the problem was due to a ‘Windows Update‘ that required a restart (which I avoided the restart and kept getting this problem). But after the reboot the error was fixed.

Community's user avatar

answered Dec 29, 2014 at 20:46

Sia's user avatar

SiaSia

1112 silver badges5 bronze badges

Installing visual C++ 2008 SP1 fixed my issue.

Jyo the Whiff's user avatar

answered Mar 12, 2014 at 12:00

User's user avatar

UserUser

3511 gold badge8 silver badges20 bronze badges

1

If you have #include<stdfafx.h>, try commenting it out like so //#include<stdfafx.h> as it may be the culprit behind your errors.

Quetzalcoatl's user avatar

Quetzalcoatl

3,0272 gold badges17 silver badges27 bronze badges

answered Aug 7, 2012 at 21:45

Art's user avatar

ArtArt

1411 silver badge10 bronze badges

1

  • Remove From My Forums
  • Question

  • How to solve ,

    fatal error C1859: ‘ReleaseTest.pch’ unexpected precompiled header error, simply rerunning the compiler might fix this problem  in VC++ MFC?

    both Release and Debug

    fatal error C1859: ‘DebugTest.pch’ unexpected precompiled header error, simply rerunning the compiler might fix this problem  in VC++ MFC  ?

    all the error line point to the ,

    #include "stdafx.h"

    how can i solve this?

    • Edited by

      Wednesday, June 3, 2015 12:23 PM

Answers

  • Try Build -> ReBuild Sulution. please let me know, if this not works.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click
    HERE to participate the survey.

    • Proposed as answer by
      Shu 2017
      Friday, June 5, 2015 7:49 AM
    • Marked as answer by
      Shu 2017
      Tuesday, June 16, 2015 12:45 PM

Check the output directory of the project, delete the whole directory and regenerate it (PCH file directory, general release directory). If the error is still reported after deleting the single level directory, delete the multi-level directory (such as x64/release) and rerun the compiler.

Read More:

  • Far cry 5 ошибка snowshoe 9e42873b как исправить
  • Far cry 5 ошибка snowshoe 64eeaa8d
  • Far cry 5 ошибка snowshoe 593036c0 ps4
  • Far cry 5 ошибка snowshoe 2096ea55 как исправить ошибку
  • Far cry 5 ошибка bookworm 6e739f5b