gpt4 book ai didi

c++ - 如何在 Visual Studio 中调试命令行实用程序

转载 作者:行者123 更新时间:2023-11-28 06:16:53 25 4
gpt4 key购买 nike

我在 visual studio 中有 C++ 代码和一个带有 pdb 文件的 exe,该 exe 是一个命令行实用程序。

我想调试可执行文件。我无法在 visual studio 中编译源代码,因为它有一个很大的编号。依赖项。

有没有一种方法可以附加调试器来调试可执行文件。

最佳答案

如果它是用 VC++ 编译的,那么是的。运行您的代码,并从菜单附加调试器:“调试/附加到进程”。

如果您想在已附加调试器的情况下启动该过程,请按照本教程进行操作:

http://msdn.microsoft.com/en-us/library/0bxe8ytt.aspx .

To create an EXE project for an existing executable

  1. On the File menu, click Open and select Project.

  2. In the Open Project dialog box, click the drop-down list next to the File name box, and select All Project Files.

  3. Locate the executable, and click OK.

    This creates a temporary solution that contains the executable.

如果您这样做了,您只需点击“调试”即可。

关于c++ - 如何在 Visual Studio 中调试命令行实用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30098847/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com