D语言讨论 怎么搞 windows下面D语言基本开发环境与VSCode 调试?谁知道怎么弄

· Created · Last modified by Brian replied at · 3412 times read

怎么搞 windows下面D语言基本开发环境与VSCode 调试?

VSCode 每个平台都差不多,参照《Linux下面D语言基本开发环境与VSCode 调试

参考:https://wiki.dlang.org/Installing_DMD
安装Visual Studio

修改VS Code的设置,加入一项:

"debug.allowBreakpointsEverywhere": true

如下图,添加调试设置文件,并设置需要调试的执行文件。
20200106094050.png

按F5即可开始调试。

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(Windows) 启动",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "${workspaceFolder}/app.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true
        }
    ]
}

The thread 21708 has exited with code 0 (0x0).

The thread 9508 has exited with code 0 (0x0).

The thread 12096 has exited with code 0 (0x0).

The thread 1788 has exited with code 0 (0x0).

The thread 21840 has exited with code 0 (0x0).

The thread 10032 has exited with code 0 (0x0).

The thread 13824 has exited with code 0 (0x0).

The thread 7216 has exited with code 0 (0x0).

The thread 11824 has exited with code 0 (0x0).

The thread 15604 has exited with code 0 (0x0).

The thread 5044 has exited with code 0 (0x0).

The thread 5408 has exited with code 0 (0x0).

The thread 4684 has exited with code 0 (0x0).

The program '[6240] app.exe' has exited with code 0 (0x0).

还是不能调试,会自动退出1

确定设置了断点?Mac下的lldb不好使,其他平台都没问题的。

肯定设置了断点的,楼上的你能共享下配置么?????

"debug.allowBreakpointsEverywhere": true

这个参数也加了的。

楼主,麻烦问下执行dub run报这个错是哪里有问题。
lld-link: error: could not open libcmt.lib: no such file or directory
Error: linker exited with status 1

很明显是libcmt.lib打不开,或找不到啊,你搜索一下看有没这个文件

既然是windows上为什么不用visual D,跟VC++一样一键调试

Windows 下安装有问题可以查看:
https://forums.dlangchina.com/thread/10029

VisualD 结合 VS 2019 来说还是很好用的,只是我在 macOS 平台难得用一次 VS : )

不过建议对 C# 和 VC++ 开发环境熟悉的选择 VS 进行开发。

Login to reply