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   风中狂笑  阅读(824)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示