visualstudio2015在调试期间挂起默认控制台应用程序文件



当我选择控制台应用程序时,默认文件是

#include "stdafx.h"
int main()
{
  return 0;
}

当我点击"本地窗口调试器"时,程序会冻结,什么也不会发生。我的调试编译器可能没有链接到正确的可执行文件吗?

当前的编写方式将导致语法错误编译错误,因为您忘记了return 0之后的;。不过,它很可能只是立即关闭程序,试着运行这段代码并检查它是否打印出来:

你好,世界!

#include "stdafx.h"
#include <iostream>
int main()
{
  std::cout << "Hello, World!" << std::endl;
  std::cin.get();
  return 0;
}

如果这仍然"冻结"了调试器,那么我建议重新安装Visual Studio。

最新更新