MinGW-w64安装

本文详细指导如何通过SourceForge下载并安装Mingw-w64,包括选择x86_64架构、指定安装目录,以及如何将Mingw-w64编译器添加到Windows PATH环境变量。最后,验证安装的有效性,确保g++和gdb命令可用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Example: Install MinGW-x64#

We will install Mingw-w64 via the SourceForge website. You can use this Mingw-w64 link to download the Windows Mingw-w64 installer.

  1. Run the installer, which should be named mingw-w64-install.exe in your Download folder.
    2在这里插入图片描述
    For Architecture select x86_64 and then select Next.
    在这里插入图片描述

  2. On the Installation Folder page, use the default location for the Destination folder. Copy the location as you will need it later.

  3. Select Next to start the installation.

Add the MinGW compiler to your path#

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 and then select Edit.
  4. Select New and add the Mingw-w64 destination folder path, with \mingw64\bin appended, 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:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\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.

Check your MinGW installation#

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

g++ --version
gdb --version

If you don’t see the expected output or g++ or gdb is not a recognized command, check your installation (Windows Control Panel > Programs > Programs and Features) and make sure your PATH entry matches the Mingw-w64 binary location where the compiler tools are located.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值