C Program exe file defined as a Trojan:Win32 Virus. How to solve this problem?

261 views Asked by At

screenshot

When I run a basic C code in VS Code then windows defender called it a Trojan:Win32. It makes the file removed. It really makes difficulties. So, what should I do now?

I reinstall the mingw compiler for it, but it goes the same things again and again. Now I want to solve this problem but couldn't get any solution.....

2

There are 2 answers

0
anatolyg On

Build either a release version or if 32-bit, change to 64-bit or vice-versa. Alternatively, change the compilation model from MDd to MTd or even just MD or MT.

– cup

2
Sói On

If Windows Defender is flagging your compiled C code as a Trojan, it’s likely a false positive. This can happen when antivirus programs mistakenly identify safe files as malicious.

Here are a few steps you can take to address the issue:

  1. Add your build directory to the exclusion list of Windows Defender. This can prevent it from scanning and removing your compiled executable. You can find this setting in Windows Security under “Virus & threat protection” -> “Manage settings” -> “Add or remove exclusions.”
  2. You can disable Windows Defender (only if absolutely necessary, as it may pose risks to your computer by leaving it vulnerable to other potential threats)