简体   繁体   English

“ Hello world!”冻结在c ++中

[英]“Hello world!” freeze in c++

I tried to compile a simple Hello World in C++ to test that my Visual Studio 2013 on my Windows 10 works well but I've a problem. 我试图用C ++编译一个简单的Hello World,以测试Windows 10上的Visual Studio 2013能否正常运行,但是我遇到了问题。 My program compile but when I run, it freeze. 我的程序可以编译,但是运行时会冻结。 It's an empty Win32 Console Application with a "main.cpp" : 这是一个带有“ main.cpp”的空Win32控制台应用程序:

#include <iostream>
using namespace std;

int main()
{
    cout << "Hello world!";
    return 0;
}
  • If I launch it from Visual Studio in debug (with "Run"), Visual Studio freeze and I need to kill its task. 如果我从Visual Studio中通过调试(带有“运行”)启动它,则Visual Studio冻结,我需要终止它的任务。
  • If I launch it with the executable or with "Run without Debugging", nothing appear, "System" process doesn't want to free the execution and I can't recompile without restart the computer because of that. 如果我使用可执行文件或“无需调试运行”启动它,则什么也没有出现,“系统”进程不想释放执行,因此,如果不重新启动计算机就无法重新编译。

I am confused. 我很困惑。 If somebody have an idea of what's happening, please help me. 如果有人对发生的事情有所了解,请帮助我。

Update 1 : I repair my installation. 更新1 :我修复我的安装。 Same problem. 同样的问题。 Breakpoint doesn't help. 断点没有帮助。 It seems to freeze before. 好像以前冻结了。 And also no trace of a task in the task manager when launched without debugging. 如果不进行调试,则在任务管理器中也找不到任务的痕迹。

It was my antivirus' fault (in my case, Avast). 这是我的防病毒软件的错误(在我的情况下是Avast)。 I made it ignore my Visual Studio projects and it works. 我使它忽略了我的Visual Studio项目,并且可以正常工作。 Solved by @Blastfurnace. 由@Blastfurnace解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM