我安裝了 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 解決了該問題。