VS Code C++ issue

233 views Asked by At

I tried to compile a cpp file using VScode, but I have got an issue. The tdm-gcc have already added to environment variable. I tried to reboot my computer but it didn't work. Here is the error.

error:

/usr/bin/bash: D:TDM-GCC-64bing++.exe: command not found
The terminal process terminated with exit code: 127
1

There are 1 answers

0
JamieNguyen On

I have encountered the exact same problem as yours and I think I found a fix.

You probably have Git Bash as your default integrated shell in VSCode in Windows. As the shell parses the path it removes the slashes /. To fix it, you should surround any path with \" that is found in your tasks.json. This forces the shell to interpret the path correctly. Attached is the args of my tasks.json. Hope this helped.

"args": [
            "-g",
            "-Wl,--stack,256000000",
            "-Wl,--heap,256000000",
            "\"${file}\"",
            "-o",
            "\"${fileDirname}\\${fileBasenameNoExtension}.exe\"",
            "-std=c++11",
            "-O2",
        ],