Windows 8.1运行c++程序后死机

Windows 8.1 freezes after running a C++ program

本文关键字:程序 死机 c++ 运行 Windows      更新时间:2023-10-16

我一直在用Ubuntu编程,我偶尔也用过Windows 8,它总是运行得很好。现在我升级到Windows 8.1,并安装了Visual Studio 2013和Qt Creator与MinGW,所以我可以在任何操作系统中学习c++。

问题是当我运行一个c++程序时,它会冻结我用来运行它的代码。我用MinGW和VS编译器编译了这个程序,我总是有这个问题。代码只不过是一个简单的Hello World,所以我不知道发生了什么。我在Windows 8.1中通过命令提示符运行了一个c#程序,一切正常,但是当我尝试一个c++程序时,命令提示符冻结了,即使使用taskkill/PID/t/f,我也无法关闭它,它说:

ERROR: The process with PID <pid> (child process of PID <pid>) could not be terminated. Reason: There is no running instance of the task.

有时我可以让命令退出,但它仍然留在任务列表中。它甚至一度冻结了Visual Studio。大多数时候,我不能关闭命令提示符,我不能在它上面写任何东西,它一直在消耗内存和cpu。我已经试着找到一个解决办法,但是我找不到,我希望我能在这里得到一些帮助。

编辑

我使用Avast! 2014,代码是:

#include <iostream>
int main()   {
  std::cout << "Hello, world" << std::endl;
  return 0;
}

从评论到问题:

  • 一种可能:杀毒软件干扰。

  • 问题确实出在我的杀毒软件上。