首页 > 编程语言 >【C/C++】VsCode调试配置tasks.json和launch.json

【C/C++】VsCode调试配置tasks.json和launch.json

时间:2024-04-03 14:33:44浏览次数:17  
标签:exe launch json tasks file ++.

前段时间配大作业环境改了很多配置,发现tasks.json和launch.json经常令自己很迷惑。网上找的配置有时会有各种各样的问题,在此记录一下上学期配好的配置文件,日后有时间再详细研究研究

tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "g++.exe build active file",
            "command": "D:\\newMinGW\\mingw64\\bin\\g++.exe",  
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "D:\\newMinGW\\mingw64\\bin"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "g++.exe build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,  
            "MIMode": "gdb",
            "miDebuggerPath": "D:\\newMinGW\\mingw64\\bin/gdb.exe",  
            "setupCommands": [
                {
                    "description": "为 gdb 启用整齐打印",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "g++.exe build active file"
        }
    ]
}

标签:exe,launch,json,tasks,file,++.
From: https://www.cnblogs.com/liu-yc/p/18112635

相关文章

  • ETL工具-nifi干货系列 第七讲 处理器JoltTransformJSON(续)
    第六讲教程只简单介绍了Jolt的chain转换模式,本节课介绍下Jolt的各种转换模式。点击的处理器JoltTransformJSON高级配置选项,进行测试Jolt的转换模式。 1、Cardinality:更改了输入JSON数据元素的基数,适用于jsonObj和jsonList之间的转换。list转为obj input{"review......
  • ETL工具-nifi干货系列 第七讲 处理器JoltTransformJSON(续)
    第六讲教程只简单介绍了Jolt的chain转换模式,本节课介绍下Jolt的各种转换模式。点击的处理器JoltTransformJSON高级配置选项,进行测试Jolt的转换模式。1、Cardinality:更改了输入JSON数据元素的基数,适用于jsonObj和jsonList之间的转换。list转为objinput{"review......
  • Cannot deserialize the current JSON array (e.g. [1,2,3]) into type ‘model’ bec
    错误:CannotdeserializethecurrentJSONarray(e.g.[1,2,3])intotype‘model’becausethetyperequiresaJSONobject(e.g.{“name”:“value”})todeserializecorrectly.TofixthiserroreitherchangetheJSONtoaJSONobject 原因:json或xml字符串中......
  • ETL工具-nifi干货系列 第六讲 处理器JoltTransformJSON
    1、处理器作用使用Jolt转换JSON数据为其他结构的JSON,成功的路由到'success',失败的'failure'。处理JSON的实用程序不是基于流的,因此大型JSON文档转换可能会消耗大量内存。Jolt:JSON到JSON转换库,用Java编写,其中转换的"规范"或者描述文件本身就是一个JSON文档。2、属性......
  • system.text.json 搜索获取节点值
    搜索Json节点值publicstaticclassJsonStringExtensions{publicstaticboolTryGetNestValueByJsonKey(thisstringjsonString,stringkey,outstringres){res=string.Empty;try{vararr=key.Split('.');......
  • cJSON(API的详细使用教程)
    我们今天来学习一般嵌入式的必备库,JSON库1,json和cJSON那什么是JSON什么是cJSON,他们之间有什么样的关联呢,让我们一起来探究一下吧。JSON(JavaScriptObjectNotation)是一种轻量级的数据交换格式,它易于人阅读和编写,也易于机器解析和生成。JSON采用键值对的方式来表示数据,通常用......
  • groovy 字符串、json 动态拼接内容
    1.字符串拼接defids=[21321,3445,3456];defsize=ids.size();vars.put("skuNum",size);logs.add('sku数量:'+size);StringBuffersb=newStringBuffer();defrandom=newjava.util.Random();for(inti=0;i<size;i++){defskuId=......
  • Jackson 2.x 系列【10】特征配置篇之 JsonFactory.Feature、JsonGenerator.Feature、J
    有道无术,术尚可求,有术无道,止于术。本系列Jackson版本2.17.0源码地址:https://gitee.com/pearl-organization/study-jaskson-demo文章目录1.前言2.特征说明2.1JsonFactory.Feature2.2JsonGenerator.Feature2.3JsonParser.Feature3.配置特征1.前言本篇......
  • delphi基于数据模型(data-model)JSON序列
    delphi基于数据模型(data-model)JSON序列需要DELPHI10.2以上版本才能支持。1)实现JSON序列/还原的泛型模板unitserialize;///<author>cxg2024-1-11</author>interfaceusessystem.Classes,System.SysUtils,System.JSON.Serializers;typeTSerial<T:record>......
  • Json文件格式及Cpp解析
    JSON(JavaScriptObjectNotation)用于存储和传输数据,通常用于服务器-->Web端的数据传输JSON示例:{"employees":[{"firstName":"John","lastName":"Doe"},{"firstName":"Anna","lastN......