|
-
July 3rd, 2012, 01:18 PM
#1
Running certain code in codeblocks sets off AVG?
Hey, I've recently started to learn C++ and I'm using codeblocks as my IDE, but I keep getting problems with AVG free edition picking up random pieces of code as Trojans ?! I've put an example of some code that sets it off below, and the error message I get. Is there anyway I can set AVG not to trigger with any codeblocks coding I've done? I guess I could tell AVG not to trigger for that folder, if that's even possible? Thanks!
Code:
Code:
#include <iostream>
using namespace std;
class MyClass{
public:
void coolSaying(){
cout << "BUST A MOVE!!" << endl;
}
};
int main()
{
MyClass myObject;
myObject.coolSaying();
return 0;
}
Error I get:
File name: h:\Desktop\C++ projects\classes and objects 1\bin\Debug\classes and projects 1.exe
Threat name: Trojan horse Agent3.BMSZ
Detected on open.
-
July 4th, 2012, 11:39 PM
#2
Re: Running certain code in codeblocks sets off AVG?
I don't think that it has anything to do with your C++ coding. Are you sure your system is not infected with this Agent3.BMSZ?
Please make a complete scan and see what you get out of your machine.
-
July 5th, 2012, 05:02 AM
#3
Re: Running certain code in codeblocks sets off AVG?
It happens sometimes when you write very simple programs. It is just a false positive from your anti virus program: Usually, just touching anything in your source and recompiling is enough.
The problem also usually goes away good for once your program reaches about 15+ lines
Is your question related to IO?
Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.
-
July 5th, 2012, 05:20 AM
#4
Re: Running certain code in codeblocks sets off AVG?
Also, try setting it up so that the executable created is not named "1.exe"
A search of that filename brings up possible threats.
-
July 5th, 2012, 07:08 AM
#5
Re: Running certain code in codeblocks sets off AVG?
Another remote possibility is that the string "BUST A MOVE" may be present in some known trojan or virus, and AVG is checking for it.
Regards,
Paul McKenzie
-
July 5th, 2012, 07:17 AM
#6
Re: Running certain code in codeblocks sets off AVG?
Doesn't AVG let you flag certain files or directories as safe?
-
July 5th, 2012, 07:18 AM
#7
Re: Running certain code in codeblocks sets off AVG?
 Originally Posted by Paul McKenzie
Another remote possibility is that the string "BUST A MOVE" may be present in some known trojan or virus, and AVG is checking for it.
This is something I considered myself too but I was at least hoping that AV vendors stopped using this sort of test at least one decade ago. I remember sometime in the 90s when some relatively popular (EDIT: and completely benign) library of WordBASIC routines kept being mistaken for some virus named Hot just because it contained the string "This is hot!". 
Not actually impossible, though.
Last edited by Eri523; July 5th, 2012 at 07:20 AM.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
-
July 5th, 2012, 01:58 PM
#8
Re: Running certain code in codeblocks sets off AVG?
1. a full antivurus, malware, spyware scan in both safe mode and normal windows indicates no problems.
2. Changing the string text doesn't work.
3. Changing the file name doesn't work.
So I'm guessing I'll have to try another antivirus?
-
July 5th, 2012, 02:50 PM
#9
Re: Running certain code in codeblocks sets off AVG?
 Originally Posted by burgergetsbored
1. a full antivurus, malware, spyware scan in both safe mode and normal windows indicates no problems.
2. Changing the string text doesn't work.
3. Changing the file name doesn't work.
So I'm guessing I'll have to try another antivirus?
Why don't you just add your program to the safe list? The safe list is designed for these kinds of situations.
Is your question related to IO?
Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.
-
July 5th, 2012, 03:23 PM
#10
Re: Running certain code in codeblocks sets off AVG?
 Originally Posted by monarch_dodra
Why don't you just add your program to the safe list? The safe list is designed for these kinds of situations.
I've literally just started so I'm just following small tutorials at the moment. So there are many different files! Surly there is an easier thing than doing this for every file I make?
-
July 5th, 2012, 08:25 PM
#11
Re: Running certain code in codeblocks sets off AVG?
 Originally Posted by burgergetsbored
I've literally just started so I'm just following small tutorials at the moment. So there are many different files! Surly there is an easier thing than doing this for every file I make?
First of all, the compiler and linker that produces your code is not CodeBlocks. The compiler and linker combination is the Gnu compiler and linker (g++, and ld). All CodeBlocks does is give you an integrated environment so you can run these tools.
The g++ compiler is used by literally thousands of persons and companies around the world and on various hardware and operating systems. I highly doubt that there is any issue with the compiler and linker with AVG, since so many around the world use these tools and would have reported the issue. Maybe you have a virus or trojan on your system that attaches itself to your executables that you build.
Regards,
Paul McKenzie
-
July 6th, 2012, 07:19 AM
#12
Re: Running certain code in codeblocks sets off AVG?
 Originally Posted by Paul McKenzie
First of all, the compiler and linker that produces your code is not CodeBlocks. The compiler and linker combination is the Gnu compiler and linker (g++, and ld). All CodeBlocks does is give you an integrated environment so you can run these tools.
The g++ compiler is used by literally thousands of persons and companies around the world and on various hardware and operating systems. I highly doubt that there is any issue with the compiler and linker with AVG, since so many around the world use these tools and would have reported the issue. Maybe you have a virus or trojan on your system that attaches itself to your executables that you build.
Regards,
Paul McKenzie
Thanks for clearing that up for me. hmm that's weird then, I'll try running it on the computer in the other room which also has AVG on and see what I get from that. Someone on the same video said their anti virus was set off too but I guess there is a chance they're infected too. I'll do some research on the "trojan", see If I can do anything and get back to you!
-
July 6th, 2012, 07:26 AM
#13
Re: Running certain code in codeblocks sets off AVG?
 Originally Posted by burgergetsbored
I've literally just started so I'm just following small tutorials at the moment. So there are many different files! Surly there is an easier thing than doing this for every file I make?
There are many different files that are involved in the construction of a final product, your "main.exe", or whatever your project is called. That's the only file AVG is having problems with, and the only file you need to add to the safe list.
Is your question related to IO?
Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.
-
July 6th, 2012, 08:13 AM
#14
Re: Running certain code in codeblocks sets off AVG?
 Originally Posted by monarch_dodra
There are many different files that are involved in the construction of a final product, your "main.exe", or whatever your project is called. That's the only file AVG is having problems with, and the only file you need to add to the safe list.
If I were making only one big program that would be fine, but I'm working through many different tutorials at the moment so I have many different projects. Two out of the 7ish so far have set AVG off. But I can't be bothered to keep having to add programs to the safe list, I'd rather them just not be triggered at all! Wouldn't want to send it to someone for theirs to go off as well :/
-
July 6th, 2012, 09:04 AM
#15
Re: Running certain code in codeblocks sets off AVG?
Upload the file to a couple of online virus scanners (google 'online virus scan') just to make sure you're not infected.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|