1. MSYS2
国内使用中科大的源,详见:https://lug.ustc.edu.cn/wiki/mirrors/help/msys2
pacman -S mingw-w64-x86_64-toolchain
1.1 踩过的坑
初始直接安装
pacman -S gcc
而gcc -version 后发现是 7.4 而非 8.2 的。
后使用指令后版本变成 8.2 了。
pacman -S mingw-w64-x86_64-gcc
但后来 gdb 时还需要手动安装一下。若空间足够,可以手动安装。
pacman -S mingw-w64-x86_64-gdb
2. 使用 make 跑一下
test.cpp
#include<iostream>
int main(void) {
long int tag = __cplusplus;
if(tag == 201703L) std::cout << "C++17\n";
else if(tag == 201402L) std::cout << "C++14\n";
else if(tag == 201103L) std::cout << "C++11\n";
else if

本文介绍了如何在Windows 7上配置C++开发环境,包括使用MSYS2安装MinGW 64-bit工具链,解决GCC版本问题,通过make进行编译,以及利用Visual Studio Code进行代码编辑、配置和运行。重点讲述了VS Code的C/C++扩展安装、工作区设置和编译运行步骤。

7万+

被折叠的 条评论
为什么被折叠?



