Reputation: 357
When pressing ctrl+shift+b in my workspace folder, I'm getting The terminal process terminated with exit code 1
. That seems to mean the path is incorrect. Yet, I'm following instructions from Microsoft over here:
https://code.visualstudio.com/docs/cpp/config-mingw#_modifying-tasksjson
I also checked over stackoverflow and this should definitely work. When I replace *.cpp to main.cpp, it compiles without a problem. I have only one file right now but I will definitely have more in the future.
I am using vscode 1.44.2, g++ 9.3.0.
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "g++.exe build active file",
"command": "D:\\cygwin64\\bin\\g++.exe",
"args": [
"-g",
"${workspaceFolder}\\*.cpp",
"-o",
"${workspaceFolder}\\BreadShopPro.exe"
],
"options": {
"cwd": "D:\\cygwin64\\bin"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Upvotes: 4
Views: 1870
Reputation: 21
Did you put a space between the name of any folder in the directory? Putting a space makes the directory invalid (i.e. "My Project" will not be recognized, but "MyProject" will). Seems like that may be the issue. I've faced the same issue and this fixed mine.
Upvotes: 2