.exe 文件未在 VS Code 中形成

问题描述 投票:0回答:1

当一个C++文件形成时,让“new.cpp”在vs代码中执行,然后形成另一个文件“new.exe”,但在我的vs代码中它只形成一个名为“new”的文件,没有扩展名。如何纠正?

我尝试更改tasks.json,但无法弄清楚。

c++ exe
1个回答
0
投票

您可以提供构建日志或您的

tasks.json
文件吗?它应该是这样的:

{
"tasks": [
    {
        "type": "cppbuild",
        "label": "C/C++: g++.exe build active file",
        "command": "C:\\msys2\\mingw64\\bin\\g++.exe",
        "args": [
            "-fdiagnostics-color=always",
            "-g",
            "${workspaceFolder}\\main.cpp", // Your source file
            "-o",
            "${workspaceFolder}\\main.exe" // This is what the output exe is called
        ],
        "options": {
            "cwd": "${fileDirname}"
        },
        "problemMatcher": [
            "$gcc"
        ],
        "group": {
            "kind": "build",
            "isDefault": true
        },
        "detail": "Task generated by Debugger."
    }
],
"version": "2.0.0"
}
© www.soinside.com 2019 - 2024. All rights reserved.