## msys2安裝 1. 前往 [msys2](https://msys2.org)並下載||~~window7或以前請自求多福~~|| ![](https://hackmd.io/_uploads/HJJmV6L_n.png) 2. **不要改路徑** ~~除非你能背起來~~ ![](https://hackmd.io/_uploads/By4ZBaUu2.png) 3. 繼續 繼續 完成 4. 開啟msys2 ![](https://hackmd.io/_uploads/rJ3qr6U_3.png) 5. 輸入 ```bash pacman -S mingw-w64-ucrt-x86_64-gcc ``` 如果有詢問輸入`Y` 6. 前往環境變數(可以用左下角的搜尋) ![](https://hackmd.io/_uploads/rkFxs3Udn.png) 7. 選取`系統變數`中的`Path`然後按下**編輯** ![](https://hackmd.io/_uploads/HyKeohUun.png) 8. 按`新增`然後貼上這段路徑`C:\msys64\usr\bin` 如果有如果有變更路徑: 去資料夾找 `你改的路徑+\usr\bin` ![](https://hackmd.io/_uploads/SyYlonLO2.png) ## 確認是否安裝成功 1. 按下 **Windows![](https://hackmd.io/_uploads/H1g-b6Id3.png =20x20)**+`R` 2. 輸入 `cmd` 3. 輸入```g++ --version``` ```cmd g++ (Rev10, Built by MSYS2 project) 12.2.0 Copyright (C) 2022 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. ``` 代表安裝成功 ## **記得重啟vscode 和 終端機**