0

So, first time code-writer here. I just got VSC and am trying to do your typical "Hello World" basic line in the output. Nothing harmful. When I run the code (shown below) I am immediately met by Avast saying they blocked me from Win32:MalwareGen. I did not think saying hello would be so dangerous.

Input

#include <iostream>
// first comment! Woo!
int main()
{std::cout << "Hello World!";}

Output

[Running] cd "my file locations" && g++ main.cpp -o main && "more file locations

Access is denied.

[Done] exited with code=1 in 3.55 seconds

If anyone has a suggestion as to how I can convince my computer I'm not making malware, that would be really awesome! Thank you!

2 Answers2

1

This is a well-known bug in Avast that's gone unfixed for over a decade:

You basically have two choices:

  1. Uninstall Avast and switch to Windows Defender or something else that isn't complete garbage
  2. Set an exclusion on the directories that you compile programs in
  • Wow, thank you! I'll try to fiddle with somethings in the vein of what you said. Thank you a ton for helping out AND being so fast. I couldn't find anything about it and here you are with four links. Hopefully my journey won't end so quickly now! – Zack C. May 19 '20 at 05:26
-2

Windows Defender also thinks it's a virus...

Specifically with iostream...

I commented out code until the virus warning didn't pop up again.

Any other known fixes?


I ended up testing the problem...

The projects that were coming up marked as bugs were projects that I was rolling over from VS 2013 to VS 2022.

I started a project fresh in 2022 and the bug did not appear. I then added code by #include-ing the files only, not relying upon VS to do the upgrade.

Works fine now.

  • I edited to turn this into an answer. I suspect however that it will be perceived as an unhelpful answer, if as an answer at all. If you basically meant "me too", better delete this post. – Yunnosch Nov 28 '22 at 12:59
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 30 '22 at 13:25