我已经使用
pacman -S --needed base-devel mingw-w64-x86_64-toolchain
安装了带有 MSYS2 的 gcc,当我在 MSYS2 MIGW64上执行
gcc --version
时,得到了以下输出
gcc.exe (Rev7, Built by MSYS2 project) 13.1.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
但是在 powershell 上执行时得到以下输出
gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
我想在我的 powershell 内的 MSYS2 上使用 GCC,我该怎么做?
在
gcc.exe
变量的开头添加所需 PATH
的位置。
在 PowerShell 中,这看起来像这样:
$env:Path = 'C:\mingw64\bin;' + $env:Path
gcc --version