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

标签 c debugging compiler-errors cygwin 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构建的代码。

这是一个说明如何完成此操作的链接:https://code.visualstudio.com/docs/cpp/cpp-debug

同样,您似乎正在使用旧版本(GDB 8.1,而当前版本是9.2)。请查看http://winlibs.com/,以获取包含GDB 9.2的MinGW-w64最新版本的构建。

关于c - 我正在使用MinGw编译器,每当我尝试调试代码时都会出错。以及为什么在我使用mingw时它的位置是cygwin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62081392/

相关文章:

C - 如何将 realloc 与指针一起使用

debugging - Debug模式下的自由半径错误

c++ - 将C++中的 vector 元组包装为元组

python - 编译时出现 GCC 错误 : cc1 out of memory error

C Scanf 在 Xcode 中跳过

c - 使用 free() 释放内存,其指针位于指向结构的指针内

c - 用 C 读取文本文件,跳过第一行

python - 如何为 gdb 安装 python 调试信息?

android - 调试 WatchFace 时永远为 "Waiting for application to start debug server"

python - Qt:尝试在 qt 中使用 python.h 时 undefined symbol