linux中deepin的vscode配置c/c++环境及qt环境

1、首先下载g++软件包:在终端中输入命令sudo apt-get install build-essential
2、在https://www.cnblogs.com/lzhu/p/10449726.html网站中找到相关的插件配置
3、launch.json的配置
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/${fileBasenameNoExtension}.o",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"preLaunchTask": "build",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
3、按f5加others后弹出系统默认的tasks.json配置文件后
将其修改为:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0", //2.0.0为最新的版本
"tasks":
[
{
"label": "build",//任务名,和lanuch.json中的"preLaunchTask":"build"一致
"type": "shell",
"command": "g++",
"args": ["-g","${file}", "-o", "${workspaceRoot}/${fileBasenameNoExtension}.o"], // g++ 后面的命令参数,这一行是整个配置的关键如果错了则vscode会找不到要编译的文件
"problemMatcher":
{
"owner":"cpp",
"fileLocation":["relative","${workspaceRoot}"],
"pattern":
{
"regexp": "^([^\\\\s].*)\\\\((\\\\d+,\\\\d+)\\\\):\\\\s*(.*)$",
"file": 1,
"line":2,
"column":3,
"severity": 4,
"location": 2,
"message": 5
}
}
}

]
}
补充一点:字体推荐atom one dark theme
及书鼠标滑动改变字体的大小:"editor.mouseWheelZoom": true

4、随便把qt的一些配置也总结一下:
在完成上述几步之后,在qt上配置环境
1、在软件商店中下载qt creator
2、通过命令行 sudo apt-get install qt5-default
3、对qt进行配置----------->这也是解决在qt5中创建新的project时找不到kit的解决方案之一
4、将上述的软件包下载完毕之后就可以在qt creator中的构造器中选择默认桌面的kit
5、------>配置的关键在于将qt的版本从none换成我们之前的我们通过命令行下载下来的版本即可
6、配置到此结束,创建project开始编程之旅吧!

猜你喜欢

转载自www.cnblogs.com/z2529827226/p/11775821.html
今日推荐