windows11+gcc安装-good

MSYS2

MSYS2

 

然后看这个贴Get Started with C++ and MinGW-w64 in Visual Studio Code

上面的pacman命令其实可以用下面的来代替,因为里面包含了gcc

>pacman -S mingw-w64-ucrt-x86_64-gcc

>pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain

 

 

 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

安装之后,在msys的terminal中执行,可以去安装目录下寻找(这个其实你安装完成之后mysys后不要关闭就行,在那个命令窗口里面执行命令,而不是cmd或者pws)

 

>pacman -S mingw-w64-ucrt-x86_64-gcc

 

 Get Started with C++ and Mingw-w64 in Visual Studio Code

>pacman -S --needed base-devel mingw-w64-x86_64-toolchain

选择默认参数(直接回车即可),会执行一系列的安装

会执行一系列的安装,比如

 

 

  Install the Mingw-w64 toolchain (pacman -S --needed base-devel mingw-w64-x86_64-toolchain). Run the pacman command in a MSYS2 terminal. Accept the default to install all the members in the toolchain group.

  1. Add the path to your Mingw-w64 bin folder to the Windows PATH environment variable by using the following steps:

    1. In the Windows search bar, type 'settings' to open your Windows Settings.
    2. Search for Edit environment variables for your account.
    3. Choose the Path variable in your User variables and then select Edit.
    4. Select New and add the Mingw-w64 destination folder path to the system path. The exact path depends on which version of Mingw-w64 you have installed and where you installed it. If you used the settings above to install Mingw-w64, then add this to the path: C:\msys64\mingw64\bin.
    5. Select OK to save the updated PATH. You will need to reopen any console windows for the new PATH location to be available.
    6.  

Check your MinGW installation

To check that your Mingw-w64 tools are correctly installed and available, open a new Command Prompt and type:

gcc --version
g++ --version
gdb --version


在powershell中

 

posted on 2023-06-27 16:58  风中狂笑  阅读(575)  评论(0编辑  收藏  举报

导航