C++ Visual Studio 无法调试,只能附加
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21210847/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio can't debug, can only attach
提问by user3179229
I cannot press F5to debug my program, because there is only an Attach...button instead of a Debugbutton.
我不能按F5来调试我的程序,因为只有一个Attach...按钮而不是一个Debug按钮。
I am using a .c source file, and I was able to debug my sources until I changed a .cpp to a .c and now every source file I open, it says "Attach...". What do I do?
我使用的是 .c 源文件,并且我能够调试我的源,直到我将 .cpp 更改为 .c 并且现在我打开的每个源文件都显示“附加...”。我该怎么办?
回答by user3140854
Try menu Tools→ Customize→ Commands→ Add command...[button]→ Debug(under Categories). Find and add the button you would like to.
尝试菜单工具→自定义→命令→添加命令...[按钮]→调试(在Categories下)。找到并添加您想要的按钮。
Also try setting your project to startup one - in Solution Explorer - right click on the project and choose the Set as Startupproject option.
还可以尝试将您的项目设置为启动项目- 在解决方案资源管理器中 - 右键单击该项目并选择“设置为启动项目”选项。