IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 开发工具 -> Using GCC with MinGW on Windows -> 正文阅读

[开发工具]Using GCC with MinGW on Windows

In this tutorial, you configure Visual Studio Code to use the GCC C++ compiler (g++) and GDB debugger from?mingw-w64?to create programs that run on Windows.

After configuring VS Code, you will compile and debug a simple Hello World program in VS Code. This tutorial does not teach you about GCC, GDB, Mingw-w64, or the C++ language. For those subjects, there are many good resources available on the Web.

If you have any problems, feel free to file an issue for this tutorial in the?VS Code documentation repository.

Prerequisites#

To successfully complete this tutorial, you must do the following steps:

  1. Install?Visual Studio Code.

  2. Install the?C/C++ extension for VS Code. You can install the C/C++ extension by searching for 'c++' in the Extensions view (Ctrl+Shift+X).

  3. Get the latest version of Mingw-w64 via?MSYS2, which provides up-to-date native builds of GCC, Mingw-w64, and other helpful C++ tools and libraries. You can download the latest installer from the MSYS2 page or use this?link to the installer.

  4. Follow the?Installation?instructions on the?MSYS2 website?to install Mingw-w64. Take care to run each required Start menu and?pacman?command, especially Step 7, when you will install the actual Mingw-w64 toolset (pacman -S --needed base-devel mingw-w64-x86_64-toolchain).

  5. 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.

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, make sure your PATH entry matches the Mingw-w64 binary location where the compilers are located. If the compilers do not exist at that PATH entry, make sure you followed the instructions on the?MSYS2 website?to install Mingw-w64.

  开发工具 最新文章
Postman接口测试之Mock快速入门
ASCII码空格替换查表_最全ASCII码对照表0-2
如何使用 ssh 建立 socks 代理
Typora配合PicGo阿里云图床配置
SoapUI、Jmeter、Postman三种接口测试工具的
github用相对路径显示图片_GitHub 中 readm
Windows编译g2o及其g2o viewer
解决jupyter notebook无法连接/ jupyter连接
Git恢复到之前版本
VScode常用快捷键
上一篇文章           查看所有文章
加:2022-05-16 11:25:52  更:2022-05-16 11:26:33 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/14 15:12:33-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码