Witam,
mam problem z debugowaniem kodu w VSCode, kiedy korzystam z terminala bash. Gdy korzystam z powershella to wszystko działa dobrze. Mogę kompilować, debugować. Niestety jak tylko zmieniam konsolę na bash to podczas próby kompilacji lub debugowania wyskakuje mi błąd:
> Executing task: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\g++.exe -g C:\Users\Adam\Projekty\Moje\helloworld\main.cpp -o C:\Users\Adam\Projekty\Moje\helloworld\main.exe <
/usr/bin/bash: C:mingw-w64x86_64-8.1.0-posix-seh-rt_v6-rev0mingw64bing++.exe: command not found
The terminal process terminated with exit code: 127
Dodam jeszcze, że w bashu kompilacja za pomocą komendy g++ main.cpp lub z pomocą makefile działa poprawnie.
Nie działa jedynie korzystanie z funkcjonalności rozszerzenia C/C++ for Visual Studio Code. Czyli kompilowanie za pomocą Tasks: Run Tasks lub Ctrl+Shift+B oraz Debugowanie
Poniżej macie mój filmik obrazujący ten problem oraz zawartość moich plików konfiguracyjnych:
https://www.youtube.com/watch?v=lElH2V57MpE
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "g++.exe build active file",
"command": "C:\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\g++.exe",
"args": ["-g", "${workspaceFolder}\\main.cpp", "-o", "${workspaceFolder}\\main.exe"],
"options": {
"cwd": "C:\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin"
},
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "g++.exe build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "g++.exe build active file"
}
]
}
c_cpp_properties.json
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"cStandard": "c11",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-x64",
"compilerPath": "C:\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\g++.exe"
}
],
"version": 4
}