简体   繁体   English

C程序无法运行

[英]C programs stuck on run

After installing windows 10 a couple of month ago i tryed to run a very simple C program, firtsly in Visual Studio 2015, and the entire IDE froze. 在几个月前安装Windows 10之后,我尝试在Visual Studio 2015中运行一个非常简单的C程序,整个IDE陷入僵局。 Then I tried compiling via command line. 然后,我尝试通过命令行进行编译。 The build is always succesfull with no problems but when i try to run a program nothing happens, the terminal just doesn't do anything and I can't even go back. 构建总是成功的,没有问题,但是当我尝试运行程序时,什么也没发生,终端什么也没做,我什至不能回去。 Sometimes I can't even kill the process the .exe file generated even though I'm using an admin account! 有时,即使使用管理员帐户,我什至都无法终止生成的.exe文件的进程!

I tried the easiest program: 我尝试了最简单的程序:

#include <stdio.h>
#include <stdlib.h>

int main(void) {
    printf("Hello World!\n");

    system("pause");     //or getchar()
    return 0;
}

and the result is just the flashing white underscore in a terminal that I can't even close. 结果就是我什至无法关闭的终端中闪烁的白色下划线。 I've tried every compiler and every different C/C++ IDE possible, this is so strange, please help! 我已经尝试过每种编译器和每种不同的C / C ++ IDE,这很奇怪,请帮忙!

I had the same problem as you, the programs did not run despite being compiled just fine(for the record I used mingw and win7) and I turned the avast shields off and the problem was solved. 我和你有同样的问题,尽管编译很好,但程序仍然没有运行(我使用mingw和win7记录),我关闭了avast防护罩,问题得以解决。 Not sure about the particular settings you need to apply to avast to keep them on and run programs normally. 不确定需要用于avast的特定设置以保持它们正常运行并运行程序。

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

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