mingw64 未使用 msys2 正确安装

mingw64 not installed properly using msys2

我正在尝试使用 msys2 安装 ming_w64。我使用以下命令安装它:

pacman -S mingw-w64-x86_64-toolchain

安装编译后出现如下错误:

$ g++ test.cpp
g++.exe: fatal error: cannot execute 'cc1plus': CreateProcess: No such file or directory
compilation terminated.

重新安装后 ming_w64 显示如下:

:: Proceed with installation? [Y/n]
(19/19) checking keys in keyring                                 [##################################] 100%
(19/19) checking package integrity                               [##################################] 100%
(19/19) loading package files                                    [##################################] 100%
(19/19) checking for file conflicts                              [##################################] 100%
(19/19) checking available disk space                            [##################################] 100%
warning: could not get file information for mingw64/lib/gcc/x86_64-w64-mingw32/11.2.0/cc1.exe
warning: could not get file information for mingw64/lib/gcc/x86_64-w64-mingw32/11.2.0/cc1plus.exe
warning: could not get file information for mingw64/lib/gcc/x86_64-w64-mingw32/11.2.0/lto1.exe
warning: could not get file information for mingw64/lib/gcc/x86_64-w64-mingw32/11.2.0/gnat1.exe
warning: could not get file information for mingw64/lib/gcc/x86_64-w64-mingw32/11.2.0/f951.exe
warning: could not get file information for mingw64/lib/gcc/x86_64-w64-mingw32/11.2.0/cc1obj.exe
warning: could not get file information for mingw64/lib/gcc/x86_64-w64-mingw32/11.2.0/cc1objplus.exe

即使重新安装后,我也无法在 mingw64/lib/gcc/x86_64-w64-mingw32/11.2.0

中找到 cc1plus.exe

我该如何解决这个问题?

感谢HolyBlackCat 我解决了。 删除这些文件的是 Windows Defender。排除该文件夹修复它。