首页 > 系统相关 >Ubuntu 18.0 vscode 配置 C环境

Ubuntu 18.0 vscode 配置 C环境

时间:2023-09-17 19:45:03浏览次数:56  
标签:false vscode json apt Runner gdb Ubuntu Cpp 18.0

sudo apt-get update

sudo apt install gcc
sudo apt install gdb
sudo apt install clang
sudo apt install lldb

 

c_cpp_properties.json

{
  "configurations": [
    {
      "name": "linux-gcc-x64",
      "includePath": [
        "${workspaceFolder}/**"
      ],
      "compilerPath": "/usr/bin/gcc",
      "cStandard": "${default}",
      "cppStandard": "${default}",
      "intelliSenseMode": "linux-gcc-x64",
      "compilerArgs": [
        ""
      ]
    }
  ],
  "version": 4
}

  

 

launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "(gdb) Launch",
      "type": "cppdbg",
      "request": "launch",
      "program": "${workspaceFolder}/${fileBasenameNoExtension}.out",
      "args": [],
      "stopAtEntry": false,
      "cwd": "${workspaceFolder}",
      "environment": [],
      "externalConsole": true,
      "MIMode": "gdb",
      "preLaunchTask": "build",
      "setupCommands": [
        {
          "description": "Enable pretty-printing for gdb",
          "text": "-enable-pretty-printing",
          "ignoreFailures": true
        }
      ]
    },
    {
      "name": "C/C++ Runner: Debug Session",
      "type": "cppdbg",
      "request": "launch",
      "args": [],
      "stopAtEntry": false,
      "externalConsole": false,
      "cwd": "/home/geovindu/桌面/ctest",
      "program": "/home/geovindu/桌面/ctest/build/Debug/outDebug",
      "MIMode": "gdb",
      "miDebuggerPath": "gdb",
      "setupCommands": [
        {
          "description": "Enable pretty-printing for gdb",
          "text": "-enable-pretty-printing",
          "ignoreFailures": true
        }
      ]
    }
  ]
}

  

settings.json

 

{
  "C_Cpp_Runner.cCompilerPath": "gcc",
  "C_Cpp_Runner.cppCompilerPath": "g++",
  "C_Cpp_Runner.debuggerPath": "gdb",
  "C_Cpp_Runner.cStandard": "",
  "C_Cpp_Runner.cppStandard": "",
  "C_Cpp_Runner.msvcBatchPath": "",
  "C_Cpp_Runner.useMsvc": false,
  "C_Cpp_Runner.warnings": [
    "-Wall",
    "-Wextra",
    "-Wpedantic",
    "-Wshadow",
    "-Wformat=2",
    "-Wcast-align",
    "-Wconversion",
    "-Wsign-conversion",
    "-Wnull-dereference"
  ],
  "C_Cpp_Runner.msvcWarnings": [
    "/W4",
    "/permissive-",
    "/w14242",
    "/w14287",
    "/w14296",
    "/w14311",
    "/w14826",
    "/w44062",
    "/w44242",
    "/w14905",
    "/w14906",
    "/w14263",
    "/w44265",
    "/w14928"
  ],
  "C_Cpp_Runner.enableWarnings": true,
  "C_Cpp_Runner.warningsAsError": false,
  "C_Cpp_Runner.compilerArgs": [],
  "C_Cpp_Runner.linkerArgs": [],
  "C_Cpp_Runner.includePaths": [],
  "C_Cpp_Runner.includeSearch": [
    "*",
    "**/*"
  ],
  "C_Cpp_Runner.excludeSearch": [
    "**/build",
    "**/build/**",
    "**/.*",
    "**/.*/**",
    "**/.vscode",
    "**/.vscode/**"
  ],
  "C_Cpp_Runner.useAddressSanitizer": false,
  "C_Cpp_Runner.useUndefinedSanitizer": false,
  "C_Cpp_Runner.useLeakSanitizer": false,
  "C_Cpp_Runner.showCompilationTime": false,
  "C_Cpp_Runner.useLinkTimeOptimization": false
}

  

 

tasks.json

{
 
	// See https://go.microsoft.com/fwlink/?LinkId=733558
	
	// for the documentation about the tasks.json format
	
	"version": "2.0.0",
	
	"tasks": [
	
	{
	
	"label": "build",
	
	"type": "shell",
	
	"command": "gcc",  //C++   using   g++
	
	"args": ["-g", "${file}", "-std=c++11", "-o", "${fileBasenameNoExtension}.out"]
	
	}
	
	]
	
   }

  

 

 

 

标签:false,vscode,json,apt,Runner,gdb,Ubuntu,Cpp,18.0
From: https://www.cnblogs.com/geovindu/p/17709588.html

相关文章

  • ubuntu22.4安装Supervisor
    安装Supervisorsudoaptupdate&&sudoaptinstallsupervisor 查看安装状态sudosystemctlstatussupervisorsudosystemctlstopsupervisorsudosystemctlstartsupervisorsudosystemctlrestartsupervisor /etc/supervisor 安装路径在配置程序时需......
  • CentOS、Ubuntu、Debian三个linux比较异同
    Linux有非常多的发行版本,从性质上划分,大体分为由商业公司维护的商业版本与由开源社区维护的免费发行版本。商业版本以Redhat为代表,开源社区版本则以debian为代表。这些版本各有不同的特点,在不同的应用领域发挥着不同的作用,不能一概而论。而绝大多数VPS上只提供开源社区维护的发......
  • ubuntu实践遇见的BUG分享
    一、如果出现了如图情况 那就代表你创立得文件,无法执行写操作权限 只需要chmod-R777文件名即可 即所有者所在组其他人都可以新建啦!二、快捷键三、如图代表续行的意思按快捷键Ctrl+c或者+l即可退出哦!四、cp的误区使用将test下文件转移到下图地址中去不要这样要告诉hellow......
  • Ubuntu下载离线仓库
    #############config###################setbase_path/var/www/html#setmirror_path$base_path/mirror#setskel_path$base_path/skel#setvar_path$base_path/var#setcleanscript$var_path/clean.sh#setdefaultarch<runninghostarc......
  • 使用 vscode 启动服务共享本地图片时快速查看图片脚本
    document.querySelectorAll("a").forEach(e=>{e.onclick=(()=>false)})letimg=document.createElement('img')letinput=document.querySelector('#input')img.src=''img.title=nameimg.style="position......
  • Ubuntu16.04下C语言编译及makefile应用
    一、不同环境下C语言的编译在Ubuntu16.04下:step1:编写main1.c主程序用nano编好,下面为主程序展示注意:1、主程序中函数的声明step2:编写子程序 step3:用gcc命令编译采用多个文件一起编译,输出放在main1中 gcc的常见用法:-c只生成目标文件不进行连接,用于对目标文件的分别......
  • 在Ubuntu20.0下搭建CUDA、cuDNN、Anaconda、pycharm
    其他链接1.buntu18.04下搭建CUDA、cuDNN、Anaconda、tensorflow1.15、Pycharm、ros、Cl2.pip使用中科大源、清华源或修改默认源为中科大源、清华源安装照着链接1的方法就可以下好cuda、cudnn和anaconda1.先装驱动,检验驱动nvidia-smi出现这个页面就成功了2.安装cuda,检验c......
  • markdown使用vscode生成目录
    要想用vscode生成目录,按照如下步骤执行即可:需要先安装插件MarkdownAllinone在想要插入目录的地方快捷键Ctrl+Shift+P然后在弹出的框里面输入TOC3.选择命令createtableofcontents就完成了目录生成如果想要导出为Html页面的话输入Ctrl+Shift+P然后在弹出的......
  • 申通ubuntu1804快速装postgresql
    先eridocker一套初始化sudosh-c'echo"debhttp://apt.postgresql.org/pub/repos/apt$(lsb_release-cs)-pgdgmain">/etc/apt/sources.list.d/pgdg.list'wget--quiet-O-https://www.postgresql.org/media/keys/ACCC4CF8.asc|sudoapt-keyad......
  • VScode使用git,设置了user.name和user.email,但是仍无法推送代码到仓库的解决办法
    问题写自己项目的时候,想推送一份新的上去,突然间就推送不上去,提示需要设置user.name和user.email解决使用下面的命令检查(如果没值请先设置值):##目标仓库检查(你需要在项目文件夹下打开git)gitconfiguser.namegitconfiguser.email##全局仓库检查gitconfig--globaluser.n......