运行我的c ++代码给我一个空白控制台 [英] Running my c++ code gives me a blank console

查看:303
本文介绍了运行我的c ++代码给我一个空白控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Visual Studio 2015中运行一些c ++代码。当我构建它我没有错误,但一旦我运行它,我得到的是一个空的控制台。我不认为它冻结,因为我可以看到一个闪烁的下划线。
此外,如果我在调试模式下运行Visual Studio只是冻结。

I'm trying to run some c++ code in Visual Studio 2015. When I build it I get no errors, but once I run it, all I get is an empty console. I don't think it froze, because I can see a flashing underscore. Also if I run it in debug mode Visual studio just freezes.

我使用了一个简单的hello world代码:

I used a simple "hello world" code:

#include <iostream>
int main()
{
    std::cout << "hello world!\n";
    return 0;
}

我尝试了:

我尝试重新安装visual studio,但它没有修复任何东西。
我也试过运行一些python和c#代码,并且都没有问题。

I tried reinstalling visual studio, but it didn't fix anything. I also tried running some python and c# code and both worked without problems.

推荐答案

您是否使用Avast防病毒?如果是这样,请尝试禁用它,然后测试您的程序。最近已经有几个类似的问题,Avast是问题。

Do you use Avast antivirus? If so, try disabling it and then test your program. There have been several similar questions on SO recently and Avast was the problem.

如果这解决了这个问题,我建议您添加排除的\Visual Studio 2015 \\ \\ Projects目录,而不是完全禁用防病​​毒。您也可以使用Avast提交错误报告或尝试使用其他防病毒软件。

If that fixes the problem I suggest you add an exclusion for your "\Visual Studio 2015\Projects" directory instead of completely disabling your antivirus. You could also file a bug report with Avast or try a different antivirus.

这篇关于运行我的c ++代码给我一个空白控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆