首先Centos下install VS_CODE
管理员方式执行命令:
rpm --import https://packages.microsoft.com/keys/microsoft.asc
sh -c ‘echo -e “[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc” > /etc/yum.repos.d/vscode.repo’
yum check-update
yum install code
如果出错, 也可以用:要先下载 rpm包
rpm -ivh ode-1.19.1-1513676713.el7.x86_64.rpm --force –-nodeps
默认目录:/usr/share/code
运行code
下载插件 c++ debug … 第一个, 然后重启
然后打开c++项目文件夹
F5 》》会在同级目录下生成.vscode 目录 以及在其目录下的launch.json tasks.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
“version”: “0.2.0”,
“configurations”: [
{
“name”: “(gdb) Launch”,
“type”: “cppdbg”,
“request”: “launch”,
“program”: “ w o r k s p a c e F o l d e r