c++ - 当前步骤 : Building Tasks. json 文件

标签 c++ powershell visual-studio-code command-prompt git-bash

我在执行此 https://www.youtube.com/watch?v=DIw02CaEusY 时遇到以下错误谁能帮我找出我搞砸的地方。

    {
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "echo",
            "type": "shell",
            "command": "g++",
            "args": ["-g", "main.cpp"],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

Executing task: g++ -g main.cpp <

'g++' is not recognized as an internal or external command, operable program or batch file. The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

最佳答案

例如参见 Microsoft/vscode-cpptools/issue 1329 :

I've reproed the problem. I'm not sure why VS Code isn't picking the environment path or what path it's using, because it picks up my CMake directory somehow, but not my MinGW directory. I was able to fix this via using the full path to g++ in the command

Change the command property to from "g++" to "C:/MinGW/bin/g++".

关于c++ - 当前步骤 : Building Tasks. json 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52324337/

相关文章:

c++ - NTRUEncrypt:无法使用开源标准算法中描述的正确找到两个多项式的 GCD,无法定义是否存在 poly 的倒数

c++ - 用于优化存储/运行时算法的元编程,C++

c# - 以编程方式确定 *.ts 视频文件是否使用 aes 128 加密

typescript - 模块 "ng"在 vs 代码中没有导出成员

git - Windows 上的 msys2 git 查找共享对象文件时出错

c++ - 我如何在指向 Mat 析构函数的指针上调用 delete ~Mat()

c++ - 为什么 mpd_connection_clear_error () 在 mpd_recv_idle () 的 MPD_ERROR_TIMEOUT 之后失败?

Powershell 获取日期 : How to get Yesterday at 22:00 in a variable?

powershell - Azure使用powershell如何获取实例计数

visual-studio-code - VSCode - 如何将文件 View 拆分为单独的窗口?