Msys2升级后不能编译
Msys2升级后不能编译
Msys2升级后不能编译,然后,发现 C:\msys64
下面的三个.bat文件都不见了。
原来的快捷键指向这三个.bat文件:
MinGW-w64 Win32 Shell: C:\Windows\System32\cmd.exe /A /Q /K C:\msys64\mingw32_shell.bat MinGW-w64 Win64 Shell C:\Windows\System32\cmd.exe /A /Q /K C:\msys64\mingw64_shell.bat MSYS2 Shell: C:\Windows\System32\cmd.exe /A /Q /K C:\msys64\msys2_shell.bat
现在,只有一个命令:
C:\msys64\msys2_shell.cmd
然后,打开这个文件查看一下,就发现它的使用方法在最下面写了:
echo Usage: echo %~1 [options] [bash parameters] echo. echo Options: echo -mingw32 ^| -mingw64 ^| -msys[2] Set shell type echo -defterm ^| -mintty ^| -conemu ^| -consolez echo Set terminal type echo -here Use current directory as working echo directory echo -where DIRECTORY Use specified DIRECTORY as working echo directory echo -[use-]full-path Use full currnent PATH variable echo instead of triming to minimal echo -help ^| --help ^| -? ^| /? Display this help and exit echo. echo Any parameter that cannot be treated as valid option and all echo following parameters are passed as bash command parameters. echo.
所以,需要把原来的快捷键进行更新:
MinGW-w64 Win32 Shell: C:\Windows\System32\cmd.exe /A /Q /C C:\msys64\msys2_shell.cmd -mingw32 MinGW-w64 Win64 Shell C:\Windows\System32\cmd.exe /A /Q /C C:\msys64\msys2_shell.cmd -mingw64 MSYS2 Shell: C:\Windows\System32\cmd.exe /A /Q /C C:\msys64\msys2_shell.cmd -msys
或者,不修改快捷键,再创建几个.bat文件:
mingw32_shell.bat @echo off call "%~dp0msys2_shell.cmd" -mingw32 %* exit mingw64_shell.bat @echo off call "%~dp0msys2_shell.cmd" -mingw64 %* exit msys2_shell.bat @echo off call "%~dp0msys2_shell.cmd" -msys %* exit