Skip to content

Latest commit

 

History

History
77 lines (53 loc) · 1.29 KB

README.md

File metadata and controls

77 lines (53 loc) · 1.29 KB

use-vscode-writen-c

1.编写源码文件:

#include <stdio.h>
#include "add/add.h"
#include "sub/sub.h"

int main()
{
    int a = 5;
    int b=2;
    int sum = add(a,b);
    int su = sub(a,b);
    
    printf("sum:%d\nsub:%d\n",sum,su);
    
    return 0;
}

2.选择配置:

edit_config

edit_config

3.task

{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: gcc.exe 生成活动文件",
            "command": "D:/work/vcpkg/vcpkg/downloads/tools/perl/5.30.0.1/c/bin/gcc.exe",
            "args": [
                "-g",
                "${fileDirname}\\add\\*",
                "${fileDirname}\\sub\\*",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "D:/work/vcpkg/vcpkg/downloads/tools/perl/5.30.0.1/c/bin"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "调试器生成的任务。"
        }
    ],
    "version": "2.0.0"
}

run

仅供学习和参考.