【问题标题】:Visual Studio 2015 fatal error C1001Visual Studio 2015 致命错误 C1001
【发布时间】:2016-09-18 14:32:09
【问题描述】:

我正在尝试构建一个项目 (SUBSYSTEM:WINDOWS),我的主要看起来像这样:

int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) {/*Code here*/}

在构建发布版本时,我在 VisualStudio Community 2015 v. 14.0.25431.01 中收到以下错误:

1>e:\github\g19systemmonitor\g19tastatur applet\main.cpp : fatal error C1001: Interner Compilerfehler.
1>  (Compilerdatei "f:\dd\vctools\compiler\utc\src\p2\main.c", Zeile 255)
1>   Vereinfachen oder ändern Sie das Programm im Umfeld der oben aufgeführten Positionen. Wählen
1>  Sie im Menü "Hilfe" von Visual C++ den Befehl "Technischer Support",
1>  oder öffnen Sie die Hilfedatei des technischen Supports, um weitere Informationen zu erhalten.
1>    link!InvokeCompilerPass()+0x24399
1>    link!InvokeCompilerPass()+0x24399
1>    link!InvokeCompilerPass()+0x1dda7
1>    link!InvokeCompilerPass()+0x1dc8b
1>    link!InvokeCompilerPass()+0x298f7
1>    link!InvokeCompilerPass()+0x214ba
1>    link!DllGetC2Telemetry()+0xe39f7
1>
1>e:\github\g19systemmonitor\g19tastatur applet\main.cpp : fatal error C1001: Interner Compilerfehler.
1>  (Compilerdatei "f:\dd\vctools\compiler\utc\src\p2\main.c", Zeile 255)
1>   Vereinfachen oder ändern Sie das Programm im Umfeld der oben aufgeführten Positionen. Wählen
1>  Sie im Menü "Hilfe" von Visual C++ den Befehl "Technischer Support",
1>  oder öffnen Sie die Hilfedatei des technischen Supports, um weitere Informationen zu erhalten.
1>    link!InvokeCompilerPass()+0x24399
1>    link!InvokeCompilerPass()+0x1dda7
1>    link!InvokeCompilerPass()+0x1dc8b
1>    link!InvokeCompilerPass()+0x298f7
1>    link!InvokeCompilerPass()+0x214ba
1>    link!DllGetC2Telemetry()+0xe39f7
1>
1>
1>LINK : fatal error LNK1000: Internal error during IMAGE::BuildImage
1>
1>    Version 14.00.24215.1
1>
1>    ExceptionCode            = C0000005
1>    ExceptionFlags           = 00000000
1>    ExceptionAddress         = 502E892F (4FF40000) "D:\Programme\Visual Studio 2015\VC\bin\c2.dll"
1>    NumberParameters         = 00000002
1>    ExceptionInformation[ 0] = 00000000
1>    ExceptionInformation[ 1] = 00000036
1>
1>  CONTEXT:
1>    Eax    = 00000000  Esp    = 012FE5C0
1>    Ebx    = 00000000  Ebp    = 012FE5D4
1>    Ecx    = 05650210  Esi    = 00000024
1>    Edx    = 00000000  Edi    = 05650210
1>    Eip    = 502E892F  EFlags = 00010246
1>    SegCs  = 00000023  SegDs  = 0000002B
1>    SegSs  = 0000002B  SegEs  = 0000002B
1>    SegFs  = 00000053  SegGs  = 0000002B
1>    Dr0    = 00000000  Dr3    = 00000000
1>    Dr1    = 00000000  Dr6    = 00000000
1>    Dr2    = 00000000  Dr7    = 00000000

几周前,我能够使用与我现在完美使用的相同编译器设置和相同代码构建项目的发布版本。 我已尝试删除 MSDN 中建议的优化,但这些优化不起作用。

但我注意到了一些奇怪的事情:

当我删除 Release 文件夹中的 3 个文件 (.exe .iobj .ipdb) 并重建解决方案时,它工作得很好(正在创建 3 个文件的新版本)。当我更改项目中的任何设置或仅添加一行代码并尝试重建时,会发生相同的错误。如果我再次删除这 3 个文件中的一个,我可以再次构建。

我认为这种行为可能是由我不知道的某些编译器设置引起的,但我不确定,因为我不是 VisualStudio 专家。

【问题讨论】:

  • 德语文本只说内部编译器错误并联系支持。

标签: c++ visual-studio-2015 c1001


【解决方案1】:

这发生在我身上,我通过转到我的 Release 文件夹并删除所有 *.ipdb 文件来修复它。我注意到在 did 成功链接的项目中,Visual Studio 有时会说:

所有 5226 个函数都已编译,因为没有可用的 IPDB/IOBJ 从 找到以前的编译。

..然后,当我检查 *.ipdb 文件中无法链接的项目的日期时,我注意到文件日期仍然是 昨天晚上。一旦我删除了 Release 文件夹中的所有 *.ipdb 文件,它就会强制 Visual Studio 2015 在下一次构建时重新创建它们,然后我的项目就成功构建了!

【讨论】:

    【解决方案2】:

    好的。我通过创建一个新项目并将旧项目中的所有 .cpp 和 .h 文件添加到其中来解决了这个问题。

    我仍然认为我通过创建新项目设置为默认的项目设置存在问题。

    【讨论】:

      【解决方案3】:

      在 Visual Studio 2017 中,您需要将 Project->Properties->C/C++->Optimization->Whole Program Optimization 切换为 No 而不是 Yes。

      【讨论】:

      • 也许在您的具体情况下。内部编译器错误通常取决于编译器正在编译的代码。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-04-27
      • 1970-01-01
      • 2013-12-15
      • 2015-09-11
      • 1970-01-01
      • 1970-01-01
      • 2015-07-15
      相关资源
      最近更新 更多