如何解决Visual C ++编译器中的错误C1001? [英] How do I workaround error C1001 in visual C++ compiler?

查看:737
本文介绍了如何解决Visual C ++编译器中的错误C1001?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将Microsoft Visual Studio Enterprise 2015从Update 2升级到Update 3,现在出现以下错误:

I have just upgraded Microsoft Visual Studio Enterprise 2015 from Update 2 to Update 3 and now I am getting the following error:

严重错误C1001:内部错误有发生在编译器中。
(编译文件'f:\dd\vctools\compiler\utc\src\p2\wvm\mdmiscw.c',第2687行)
解决此问题,请尝试简化或更改上述位置附近的程序。
请在Visual C ++帮助菜单上选择技术支持命令,或打开技术支持帮助文件以获取更多信息。

fatal error C1001: An internal error has occurred in the compiler. (compiler file 'f:\dd\vctools\compiler\utc\src\p2\wvm\mdmiscw.c', line 2687) To work around this problem, try simplifying or changing the program near the locations listed above. Please choose the Technical Support command on the Visual C++ Help menu, or open the Technical Support help file for more information

该位置是第一行,其中包括标头。该项目具有设置

The location is the first line which includes a header. The project has settings


/ FR x64\Debug\ / GS / W3 / Zc:wchar_t / Zi / Od / Fd x64\Debug\vc140.pdb
/ Zc:inline / fp:precise / D WIN32 / D _DEBUG / D _WINDLL / D
_UNICODE / D UNICODE / errorReport:prompt / WX- / Zc:forScope / clr
[some / FU ...] / MDd / Fa x64\Debug\ / EHa / nologo / Fo x64\ \Debug\
/ Fp .... pch

/FR"x64\Debug\" /GS /W3 /Zc:wchar_t /Zi /Od /Fd"x64\Debug\vc140.pdb" /Zc:inline /fp:precise /D "WIN32" /D "_DEBUG" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /clr [some /FU"..."] /MDd /Fa"x64\Debug\" /EHa /nologo /Fo"x64\Debug\" /Fp"....pch"

如何重新构建项目?

推荐答案

C1001基本上表明编译器崩溃,即您可能已经创建了触发VC编译器中的错误的有效C / C ++代码。 。通过 https://connect.microsoft.com/VisualStudio/Feedback 提交错误报告可能是一个好主意。

C1001 basically indicates a compiler crash, i.e. you might have created valid C/C++ code that triggers a bug in the VC compiler. It would probably be a good idea to submit a bug report via https://connect.microsoft.com/VisualStudio/Feedback for further investigation by Microsoft.

我自己在使用Visual Studio Express 2015 Update 3编译OpenCV时遇到了C1001。我的情况是,C1001错误消息也指出了我触发编译器崩溃的OpenCV核心代码行。在查看了特定行的实际代码语义之后,我怀疑编译器的浮点处理是问题的根本原因。它正在处理一个大的,硬编码的双数组查找表,这可能会导致舍入问题。 (以防万一有人用谷歌搜索,我在这里列出了参考:opencv_core,mathfuncs_core.cpp,1261行, LOGTAB_TRANSLATE 的宏扩展)。

I myself just ran into a C1001 while compiling OpenCV with Visual Studio Express 2015 Update 3. In my case, the C1001 error message also pointed me to the OpenCV core code line that triggers the compiler crash. After looking into the actual code semantics at that particular line, I suspected the compiler's floating point handling to be the root cause of the issue. It was dealing with a big, hard-coded double array lookup table which might have caused rounding issues. (Just in case somebody googles for this, I am listing the reference here: opencv_core, mathfuncs_core.cpp, line 1261, macro-expansion of LOGTAB_TRANSLATE).

就我而言,将编译器的浮点模型从精确设置为严格解决了C1001问题。但是,由于您还没有包含导致C1001抬高的行的代码片段,因此很难说上述内容是否也可以解决您的问题。如果想尝试一下,可以在 项目设置/ C / C ++ /代码生成 标签中找到编译器开关。代替 精确(/ fp:precise) ,选择 严格(/ fp:strict) 作为浮点模型。此更改可能会影响代码的性能,但不应影响其精度。请参见 https://msdn.microsoft.com/en-us/library/e7s85ffb.aspx 有关更多信息。

In my case, setting the compiler's floating-point model from 'precise' to 'strict' resolved the C1001 issue. However, as you haven't included a code fragment of the lines that cause the C1001 to raise, it's difficult to say whether the above will fix your issue as well. If you want to give it a try, you can find the compiler switch in your project settings / C/C++ / Code Generation tab. Instead of Precise (/fp:precise), select Strict (/fp:strict) as Floating Point Model. This change may affect the performance of your code, but should not affect its precision. See https://msdn.microsoft.com/en-us/library/e7s85ffb.aspx for further information.

这篇关于如何解决Visual C ++编译器中的错误C1001?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆