VScode的C语言运行配置文件

1.launch.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": "${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
             }]
     }]
}

2.settiong.json文件(固定即可)

{
    "files.associations": {
        "array": "c",
        "atomic": "c",
        "*.tcc": "c",
        "cctype": "c",
        "chrono": "c",
        "clocale": "c",
        "cmath": "c",
        "condition_variable": "c",
        "cstdarg": "c",
        "cstdint": "c",
        "cstdio": "c",
        "cstdlib": "c",
        "cstring": "c",
        "ctime": "c",
        "cwchar": "c",
        "cwctype": "c",
        "deque": "c",
        "unordered_map": "c",
        "unordered_set": "c",
        "vector": "c",
        "exception": "c",
        "fstream": "c",
        "functional": "c",
        "initializer_list": "c",
        "iomanip": "c",
        "iosfwd": "c",
        "iostream": "c",
        "istream": "c",
        "limits": "c",
        "mutex": "c",
        "new": "c",
        "ostream": "c",
        "numeric": "c",
        "ratio": "c",
        "sstream": "c",
        "stdexcept": "c",
        "streambuf": "c",
        "system_error": "c",
        "thread": "c",
        "cinttypes": "c",
        "tuple": "c",
        "type_traits": "c",
        "utility": "c",
        "typeinfo": "c",
        "cstddef": "c",
        "algorithm": "c",
        "iterator": "c",
        "map": "c",
        "memory": "c",
        "memory_resource": "c",
        "optional": "c",
        "random": "c",
        "string": "c",
        "string_view": "c",
        "bit": "c",
        "stdlib.h": "c"
    }
}

3.task.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",        // 表示新建一个shell展示结果

        "command":"gcc",   //   "command": "g++", 表示使用的编辑器,也可为g++编译器

        "args":["${file}","-g","-o","${fileBasenameNoExtension}.out","-I.","-lhs","-L."]  // gcc后面跟的编译参数信息,语法就是gcc的参数语法,需要时添加对应编译即可,必须加-g参数,不然vscode无法进入调试功能
        }
     ]    
}

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值