我正在使用 MinGw 编译器,每当我尝试调试代码时都会出错。为什么它的位置是 cygwin 因为我正在使用 mingw

I am using MinGw compiler, whenever I'm trying to debug the code gets error failed. And why its location is of cygwin as I am using mingw

Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target: 
Debug
Adding source dir: H:\C Language\Character-Strings-(Demonstration)-Utilizing-common-string-functions-Source-code\
Adding source dir: H:\C Language\Character-Strings-(Demonstration)-Utilizing-common-string-functions-Source-code\
Adding file: H:\C Language\Character-Strings-(Demonstration)-Utilizing-common-string-functions-Source-code\bin\Debug\CommonStringFunctionsExample.exe
Changing directory to: "H:/C Language/Character-Strings-(Demonstration)-Utilizing-common-string-functions-Source-code/."
Set variable: PATH=.;C:\Program Files\mingw-w64\mingw64\bin;C:\Program Files\mingw-w64\mingw64;C:\Cygwin\bin;C:\Cygwin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;F:\runtime\win64;F:\tools\pcb\bin;F:\tools\fet\bin;F:\tools\specctra\bin;F:\tools\bin;F:\tools\PSpice\Library;F:\tools\Capture;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;C:\Program Files\IVI Foundation\VISA\Win64\Bin;F:\bin;C:\Program Files\Git\cmd;C:\Users\saihi\AppData\Local\Microsoft\WindowsApps;C:\Users\saihi\Anaconda3\Library\ssl;C:\ProgramData\saihi\atom\bin;C:\Users\saihi\AppData\Local\Programs\Microsoft VS Code\bin
Starting debugger: C:\Program Files\mingw-w64\mingw64\bin\gdb.exe -nx -fullname -quiet  -args "H:/C Language/Character-Strings-(Demonstration)-Utilizing-common-string-functions-Source-code/bin/Debug/CommonStringFunctionsExample.exe"
done
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 8.1
Starting the debuggee failed: No executable specified, use `target exec'.
Debugger finished with status 0

您将需要 GDB 来调试使用 MinGW 的 gcc 构建的代码。

这里有一个 link 解释如何完成:https://code.visualstudio.com/docs/cpp/cpp-debug

而且您似乎使用的是旧版本(GDB 8.1,而当前版本是 9.2)。查看 http://winlibs.com/ 构建最新版本的 MinGW-w64,其中包括 GDB 9.2。