windows11+gcc安装-good
然后看这个贴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.
-
Add the path to your Mingw-w64
bin
folder to the WindowsPATH
environment variable by using the following steps:- In the Windows search bar, type 'settings' to open your Windows Settings.
- Search for Edit environment variables for your account.
- Choose the
Path
variable in your User variables and then select Edit. - 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
. - Select OK to save the updated PATH. You will need to reopen any console windows for the new PATH location to be available.
-
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中
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!