1.安装C++插件,扩展中搜索C++

安装 C/C++,C/C++ Clang,C++ Intellisense

Ubuntu16 VScode配置C++

 2.新建文件夹hello,新建cpp文件hello.cpp

Ubuntu16 VScode配置C++

3. Ubuntu16 VScode配置C++

3.按 F5

选择 C++(GDB)

Ubuntu16 VScode配置C++

 

生成launch.json文件,修改program 

Ubuntu16 VScode配置C++

Ubuntu16 VScode配置C++ 4.按 Ctrl+Shift+B

配置Tasks,选择Others

Ubuntu16 VScode配置C++

Ubuntu16 VScode配置C++

修改tasks.json配置 command为"g++"

添加args ,group配置

 Ubuntu16 VScode配置C++

 5.按Ctrl+Shfit+B 生成a.out文件

按F5 执行

Ubuntu16 VScode配置C++

相关文章: