[英]Visual Studio 2015 fatal error C1001
I am trying to build a project (SUBSYSTEM:WINDOWS) and my main looks like that: 我正在尝试建立一个项目(SUBSYSTEM:WINDOWS),我的主要样子是这样的:
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) {/*Code here*/}
I get following error in VisualStudio Community 2015 v. 14.0.25431.01 when building the release version: 构建发行版本时,我在VisualStudio社区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
A few weeks ago, I was able to build a release version of the project with the same compiler settings and the same code as I use now perfectly. 几周前,我能够使用与现在完美使用的相同的编译器设置和相同的代码来构建项目的发行版本。 I have tryed to remove the optimizations as recomended in the MSDN which did not work.
我试图删除无效的MSDN中推荐的优化。
But I have noticed something strange: 但是我注意到了一些奇怪的事情:
When I delete any of the 3 files (.exe .iobj .ipdb) in the Release folder and rebuild the solution, it works just fine (new versions of the 3 files are getting created). 当我删除Release文件夹中的3个文件中的任何一个(.exe .iobj .ipdb)并重新生成解决方案时,它就可以正常工作(正在创建3个文件的新版本)。 When I change any setting in the project or when I add only a single line of code and try to rebuild, the same error occurs.
当我更改项目中的任何设置或仅添加一行代码并尝试重建时,都会发生相同的错误。 If I then delete one of those 3 files again, I can build once more.
如果然后我再次删除这3个文件之一,则可以再次构建。
I think that this behavior could be caused by some compiler setting I don't know but I am not sure as I am not a VisualStudio expert. 我认为此行为可能是由我不知道的某些编译器设置引起的,但我不确定,因为我不是VisualStudio专家。
Ok I solved the problem by creating a new project and adding all the .cpp & .h files from the old project to it. 好的,我通过创建一个新项目并将旧项目中的所有.cpp和.h文件添加到其中来解决了该问题。
I still think there was a problem with the project settings which I set to default by creating a new project. 我仍然认为项目设置存在问题,我通过创建新项目将其设置为默认项目。
在Visual Studio 2017中,您需要将项目->属性-> C / C ++->优化->整个程序优化切换为否而不是是。
This happened to me, and I fixed it by going to my Release folder and deleting all the *.ipdb files. 这发生在我身上,我通过转到我的Release文件夹并删除所有* .ipdb文件来解决此问题。 I noticed on the project that did link successfully that Visual Studio sometimes said:
我注意到上做了链接成功的是Visual Studio中有时会说,这个项目:
All 5226 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
所有5226函数均已编译,因为未找到先前编译中可用的IPDB / IOBJ。
..and then when I checked the dates on the *.ipdb files for the project that was failing to link, I noticed the file date was still from yesterday evening . ..然后,当我检查* .ipdb文件上的日期以进行链接失败时,我注意到文件日期仍为昨天晚上 。 Once I deleted all the *.ipdb files in the Release folder, it forced Visual Studio 2015 to recreate them on the next build, and then my project built successfully!
删除Release文件夹中的所有* .ipdb文件后,它迫使Visual Studio 2015在下一个版本中重新创建它们,然后我的项目成功构建!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.