samedi 24 décembre 2016

tasks.json config g++ occur error: no input files in vscode

{
    /*
     * http://ift.tt/1To7yWB
     * 2016.12.23
     */
    "version": "0.1.0",
    "command": "sh",
    "isShellCommand": true,
    "showOutput": "always",
    "args": [
        "-c"
    ],
    "tasks": [
        {
            "taskName": "cpplint",
            "suppressTaskName": true,
            "args": [
                "cpplint --verbose=0 --output=vs7 --linelength=80 ${cwd}/*.*"
            ]
        },
        {
            "taskName": "g++ -std=c++11 -Wall ${file} -o ${fileBasenameNoExtension}.o",
            "args": [
                //"g++ -std=c++11 -Wall ${file} -o ${fileBasenameNoExtension}.o"
            ],
            "problemMatcher": {
                "owner": "cpp",
                "fileLocation": [
                    "relative",
                    "${workspaceRoot}"
                ],
                "pattern": {
                    "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
                    "file": 1,
                    "line": 2,
                    "column": 3,
                    "severity": 4,
                    "message": 5
                }
            }
        }
    ]
}

This is my tasks.json file in vscode. I have a problem is when about taskName "g++", when I enter

"taskName": "g++"
"args": "g++ -std=c++11 -Wall ${file} -o ${fileBasenameNoExtension}.o"

and press cmd+p, type task g++, it will return a error:

clang: error: no input files

But, cpplint (you need $ pip install cpplint by youself) also have no parameter, it's work well, why? THX.

Aucun commentaire:

Enregistrer un commentaire