我在尝试在Visual Studio 2019版本16.7.2中构建时遇到C1001错误。这是一个C++项目,以前构建得很好,直到我今天尝试构建一个变更集。
确切的错误如下:(编辑了项目特定路径(
1>d:work[...](82): fatal error C1001: An internal error has occurred in the compiler.
1>(compiler file 'd:agent_work3ssrcvctoolscompilerutcsrcp2main.c', line 187)
以下注释:
- 该错误仅发生在Release中。调试生成和运行
- 如果我在Release中关闭所有优化,错误就会消失
- 错误发生的位置似乎与我最近对项目所做的更改无关,即VS正在报告一个翻译单元中的错误,该单元在另一个TU中进行不相关的更改之前一直在顺利构建
- 错误发生的位置实际上似乎没有问题,因为如果我在那里注释掉函数的实现,并从函数中返回一个默认值,使程序在语法上正确,那么错误就会发生在同一文件中的下一个函数中
- 关闭整个程序优化和链接时间代码生成并不能解决问题
建议
请:
-
使用准确的错误文本(如果可用(更新您的帖子
-
将您的问题发布到https://developercommunity.visualstudio.com/以及
-
查看这些链接是否适用:
- https://developercommunity.visualstudio.com/content/problem/710576/visual-studio-2019-1622-fatal-error-c1001-in-32-bi.html
- https://social.msdn.microsoft.com/Forums/vstudio/en-US/165975b4-35e9-4b40-9524-e656a4e2f359/fatal-error-c1001-an-internal-error-has-occurred-in-the-compiler?forum=visualstudiogeneral
- https://developercommunity.visualstudio.com/content/problem/664162/ice-on-valid-code-after-upgrading-to-1620.html
-
这样通知Microsoft支持的一种方法:
MSVS>帮助>发送反馈>报告问题
-
以下是MSVS支持选项的完整列表:https://visualstudio.microsoft.com/vs/support/
更新:
感谢您复制/粘贴准确的错误消息:
1>d:work[...](82): fatal error C1001: An internal error has occurred in the compiler.
1>(compiler file 'd:agent_work3ssrcvctoolscompilerutcsrcp2main.c', line 187)
这是导致错误C1001:vctoolscompilerutcsrcp2main.c
的MSVS文件
这是一份现有的微软故障报告:
https://developercommunity.visualstudio.com/content/problem/210332/c1001-internal-error-compiler-file-fddvctoolscompi.html
你好,收到,
感谢您报告错误,并包括一个出色的独立的repo,如此之快。我已经调查过了与https://developercommunity.visualstudio.com/content/problem/209359/ice-with-fpfast-in-156-and-msvc-daily-1413263051-p.html.
我将此作为副本关闭,以便人们可以收集在同一地点,当另一个bug被标记为已修复,您可以假设这个bug也是。
再次感谢
Aaron Gorenstein
软件工程师II
在搜索此错误消息/源模块时,我还发现了以下内容:https://stackoverflow.com/a/63435683/421195
如果其中任何一个对你有用,请回复!