vs2017 内部编译器错误

weixin_38048154 2017-08-21 07:48:02
https://social.msdn.microsoft.com/Forums/zh-CN/eb834ec5-94d2-4be7-a1a4-4a15a9065c72/inner-compile-error-in-vs2017?forum=visualcpluszhchs
这个问题里的问题,已经困扰小半年了,上面的帖子里,都说无法重现,可是,我这几个月中间换了无数台电脑,用了无数个 VS2017 的版本,问题总是存在。
可以在这里找到示例工程:
https://github.com/thexujie/CompileProblems
这个错误的必要条件是这些:
①使用 VS2017,包括最新的版本,15.3.1。
②工具集必须是 v141,v140 没有这个 bug。
③必须启用预编译头,并且,在预编译头里使用了示例那样的 constexpr 用法。
④在一个源文件里,访问了 constexpr 修饰的结构体的成员变量,将其赋值给一个『const』变量。
满足以上条件后,无论是 Debug 还是 Release,一旦启动编译,都会出现『编译器内部错误』。
1>------ Build started: Project: CompileProblems, Configuration: Debug x64 ------
1>stdafx.cpp
1>CompileProblems.cpp
1>INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\bin\HostX86\x64\CL.exe'
1> Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(360,5): error MSB6006: "CL.exe" exited with code 2.
1>Done building project "CompileProblems.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

...全文
14 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

476

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧