运行最简单的C ++程序时出现AVG访问被拒绝警告 [英] AVG Access Denied warning when running the simplest C++ program

查看:91
本文介绍了运行最简单的C ++程序时出现AVG访问被拒绝警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个非常简单的C ++程序:

I am running a very simple C++ program:

#include <list>
#include <vector>

int main(int argc, char **args) {

}

我转到命令提示符并编译并运行:

I go to the command prompt and compile and run:

g++ whatever.cpp
a.exe

通常这可以正常工作.它可以很好地编译,但是当我运行它时,它说访问被拒绝,并且AVG弹出,告诉我已经检测到威胁 Trojan Horse Generic 17.CKZT .我尝试再次使用Microsoft编译器(cl.exe)进行编译,但运行正常.所以我回去,并添加:

Normally this works just fine. It compiles fine, but when I run it it says Access Denied and AVG pops up telling me that a threat has been detected Trojan Horse Generic 17.CKZT. I tried compiling again using the Microsoft Compiler (cl.exe) and it runs fines. So I went back, and added:

#include <iostream>

使用g ++编译并运行.这次效果很好.

compiled using g++ and ran. This time it worked fine.

那么谁能告诉我为什么AVG会将一个空的main方法报告为特洛伊木马,但是如果包含iostream标头却没有?

So can anyone tell me why AVG would report an empty main method as a trojan horse but if the iostream header is included it doesn't?

更新:

我在main方法中添加了一个return语句,现在我发现只有返回0时我才会收到错误.其他任何返回值似乎都可以正常工作.

I added a return statement to the main method and now I find that I only get the error if I return 0. Any other return value and it seems to work fine.

这是怎么回事?

推荐答案

您在不是第一个通过防病毒软件遇到误报的人.

可能发生的情况是,防病毒启发式方法在程序中存在的标准运行时库中被触发了,因为恶意软件也使用了它们.当然,合法软件也使用它们!它没有在 iostream 上跳闸的事实可能意味着 iostream 在恶意软件编写者中并不十分流行.

What probably happened is that the antivirus heuristics tripped up on the standard runtime libraries present in your programs, since malware uses them as well. Of course, legitimate software uses them too! The fact that it didn't trip up on iostream probably means that iostream isn't very popular among malware writers.

这篇关于运行最简单的C ++程序时出现AVG访问被拒绝警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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