【问题标题】:I can't debug C in VSCode/CodeBlocks or Any IDE我无法在 VSCode/CodeBlocks 或任何 IDE 中调试 C
【发布时间】:2021-08-10 14:48:36
【问题描述】:

这是我的 launch.json

    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "gcc.exe - Build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "C:\\Program Files (x86)\\CodeBlocks\\MinGW\\bin\\gdb32.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: gcc.exe build active file"
        }
    ]
}

之前这里是gdb.exe,但是说找不到,连我也找不到.. 所以我把 gdb32.exe 放在我能找到的地方,但它仍然没有调试任何东西

我现在厌倦了这个问题......

代码块说请指定可执行路径,找不到

请帮忙,谢谢

【问题讨论】:

  • 如果您的动机是像使用 gdb 一样在 Code::Blocks 中调试 c/c++ 代码,您可以使用他们内置的调试工具。您可以在这里找到一些基本指南:dummies.com/programming/c/…
  • @AnkushPandit 那是我不能做的,伙计

标签: c++ c visual-studio-code gdb mingw


【解决方案1】:

Code::Blocks 可以在没有 MinGW 的情况下安装,这没关系,因为 MinGW-w64 维护得更好。但是MinGW-w64需要单独安装。

您可以从 https://winlibs.com/ 下载独立的 MinGW-w64,该网站还解释了如何将此编译器和调试器添加到设置中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-16
    • 2018-02-24
    • 2019-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多