Next Generation Emulation banner

1 - 11 of 11 Posts

·
The Nexus of a Crisis, and The Origin of Storms
Joined
·
767 Posts
Discussion Starter #1 (Edited)
Every single time I compile a simple Hello World console program, the resulting executable triggers AVG, saying the program has a Trojan horse in it.

Is this a common problem?

//my first program in C++

#include <iostream>;
using namespace std;

int main ()
{
cout << "Hello World!";
return 0;
}
Holy **** this makes no sense. A well known compiler, recommended by dozens of programmers, and downloaded from their official homepage via SourceForge creates a Trojan everytime it compiles a super simple script? I just dont believe it.

I also have trouble believing that the tiny piece of code above could trigger an anti-virus software.

Damnit, I guess I am stuck with MS Visual C++ afterall, and that sucks. :-(
 

·
Ƹ̵̡Ӝ̵̨̄Ʒ 龍我雷 Ƹ̵̡Ӝ̵̨̄Ʒ
Joined
·
1,201 Posts
yeah, it should work.

nevertheless, I think AVG makes a false positive like daxstu says, it's normal behavior of AVG after all, when Dev-C++ compiler creates the EXE file, avg thinks it's a virus, try to ignore that and see if the executable file outputs something to console window.
 

·
The Nexus of a Crisis, and The Origin of Storms
Joined
·
767 Posts
Discussion Starter #7
I think it probably is just AVG getting a false positive, but since I cant actually just temporarily disable it, I would be forced to uninstall it.

I was just trying to compile and run to get a simple console output, which I never got. I am assuming that AVG was preventing it from being executed.

I've been tearing through a C++ tut, aided by some scripting and such I have done. Still been forcing myself to read every word and pay attention, for all the differences in syntax and function (Now we need to introduce a new concept: The Variable! :rotflmao: ).

It has been fairly productive, and I have learned some interesting things. I also find that I really like the concept of OOP.

Anyways, thanks for all the replies, but I just got fed up and uninstalled dev-C++. If it is ultimately a better compiler, then I will use it towards the end to maximize efficiency and speed.

Right now, I have a handle on the MS offering and it works nicely. My only complaint so far is that it forces me to name a project, before I have written a letter of code. Those sorts of hand-holding features are what make me hate a lot of MS products in the first place.

BTW, as an aside, does anyone know why C++ needs a semicolon at the end of almost every line. Isn't a carriage return enough?

Thanks for the replies,
TastEPlasma
 

·
代言人
Joined
·
7,175 Posts
; means end of the line of codes.
It is the same for various different languages, such as Matlab.
Without ;, the compiler will just keep reading the code.

for instance

int y = 1;
x = y;

will become

int y = 1 x = y

which is nonsense.

Naming of solutions is for better sorting, for large projects, you might even want to create sub folders, or your debugging and compiling job will be a pain @@"
 

·
The Nexus of a Crisis, and The Origin of Storms
Joined
·
767 Posts
Discussion Starter #9
Yea, I understand the reason for the semi-colon, its just that the scripting I have been learning/doing doesn't require it; when the carriage return is placed the line is assumed to have ended. Specifically, for Sphere 0.56b, a UO (server-side) emu.

I also had trouble with the concept of writing the code inside another program; I really thought I would just need to write it in notepad and then compile it. However, having some of the basic syntax and automatic indentations and such does speed things along a bit.
 

·
Ƹ̵̡Ӝ̵̨̄Ʒ 龍我雷 Ƹ̵̡Ӝ̵̨̄Ʒ
Joined
·
1,201 Posts
besides what fadingz said, a small note also about semicolon is that could be considered also as an empty statement. which some compilers generate NOP instruction in assembly language which means No OPerand.

for example:
Code:
for(int i = 0; i<100; i++)[B] ;[/B]
note the semicolon at the end of for loop, which means here an empty statement causing a small halt in execution for 100 iterations..
 

·
Hackin 'n Slashin
Joined
·
28,630 Posts
I think it probably is just AVG getting a false positive, but since I cant actually just temporarily disable it, I would be forced to uninstall it.

I was just trying to compile and run to get a simple console output, which I never got. I am assuming that AVG was preventing it from being executed.
You can temporarily disable it.
Add the folder where the exe is to AVG's exceptions, then disable the resident shield temporarily.
 
1 - 11 of 11 Posts
Top