编译 VS 以前版本的项目时 cl.exe 崩溃

编译 VS 以前版本的项目时 cl.exe 崩溃

我安装了 VS2019,并尝试编译以前版本的项目,但 cl.exe 每次都会崩溃。有什么想法吗?

1>------ Build started: Project: HelloWorld, Configuration: Debug Win32 ------
1>StdAfx.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.21.27702\include\xtr1common(50,1): error C1001:  An internal error has occurred in the compiler.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.21.27702\include\xtr1common(50,1): error C1001: (compiler file 'msc1.cpp', line 1533)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.21.27702\include\xtr1common(50,1): error C1001:  To work around this problem, try simplifying or changing the program near the locations listed above.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.21.27702\include\xtr1common(50,1): error C1001: Please choose the Technical Support command on the Visual C++
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.21.27702\include\xtr1common(50,1): error C1001:  Help menu, or open the Technical Support help file for more information
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.21.27702\include\iosfwd(108): message :  see reference to alias template instantiation 'std::enable_if_t<std::is_integral_v<_Int>,int>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.21.27702\include\iosfwd(136): message :  see reference to class template instantiation 'std::fpos<_Statetype>' being compiled

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: CL.exe
  Application Version:  19.21.27702.2
  Application Timestamp:    5ccaddbc
  Fault Module Name:    c1xx.dll
  Fault Module Version: 19.21.27702.2
  Fault Module Timestamp:   5ccade8e
  Exception Code:   c0000005
  Exception Offset: 00313256
  OS Version:   6.3.9600.2.0.0.272.7
  Locale ID:    1033

答案1

我通过从 stdafx.h 中删除 #include 并消除编译器选项 /Fx 解决了该问题。

相关内容