ubuntu16.04配置VSCode编译执行cpp
来源:互联网 发布:自学java入门书籍推荐 编辑:程序博客网 时间:2024/06/15 07:26
- 下载vscode
- 检查系统是否有安装g++
g++ -v - 新建一个文件夹(vscode不支持直接执行单个文件)
- 新建一个cpp文件
#include<iostream>
using namespace std;
int main(){
int a=10;
int b=9;
cout<<a+b<<endl;
} - 安装插件c/c++,F5调试
- 会弹出一个launch.json文件,然后修改为如下内容
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/${fileBasenameNoExtension}.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"preLaunchTask": "g++",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
} - ctrl+p,然后输入>task,选择任务:配置任务执行程序,然后会弹出一个task.json文件,修改为如下内容
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "g++",
"isShellCommand": true,
"args": ["-g", "${file}", "-o", "${fileBasenameNoExtension}.out"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
},
"showOutput": "always"
} - 再次F5调试程序
阅读全文
0 0
- ubuntu16.04配置VSCode编译执行cpp
- vscode 配置cpp
- Ubuntu16.04下配置php+vscode+xdebug开发环境
- VSCode C++配置编译调试
- VScode配置C++编译环境
- Ubuntu16.04配置Android N编译环境
- ubuntu16.04编译android5.1环境配置
- 配置VsCode的C/C++编译环境
- ubuntu16.04 编译和配置openni2 opencv2 libfreenect2(OpenKinect)
- ubuntu16.04 配置CM13编译环境的几个操作
- Ubuntu16.04 配置sublime text 3的c编译环境
- Ubuntu16.04 源码安装Cpp-Ethereum
- linux编译cpp程序并执行
- 使用shell快速编译执行c、cpp
- ubuntu16.04编译seetaface
- Ubuntu16.04编译caffe
- Ubuntu16.04编译Tensorflow
- Ubuntu16.04 编译 OpenJDK7
- Java的BigDecimal类
- 【实践】cephfs + Ganesha环境部署
- java后台封装json数据学习(一)
- 数据级的权限管理和功能级的权限管理的区别,不使用框架(shiro,springsecurity)做权限设计的思考
- 正、反向代理区别
- ubuntu16.04配置VSCode编译执行cpp
- 微信JS-SDK开发
- 前端精选文摘:BFC 神奇背后的原理
- PYTHON实现将一个文件夹下的名字满足条件的图片拷贝复制到另一个文件夹路径
- Disconf实践指南:使用篇
- Vue.js基础
- Pycharm安装
- python的函数调用参数传递
- leetcode 15. 3Sum