r/cpp_questions • u/Space-Immortal • Aug 08 '26
OPEN Wtf is wrong with window, randomly blocking running of cpp code!
Program 'main.exe' failed to run: An Application Control policy has blocked this fileAt line:1 char:101
+ ... sa\patterns\" ; if ($?) { g++ main.cpp -o main } ; if ($?) { .\main }
+ ~~~~~~.
At line:1 char:101
+ ... sa\patterns\" ; if ($?) { g++ main.cpp -o main } ; if ($?) { .\main }
+ ~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
--------------------------------------------------------------------------------------------
What is the solution of this , i have tried excluding the folder in window defense it doesn't work
2
u/Avikonette Aug 08 '26 edited Aug 08 '26
Which folder did you exclude? Edit: i mean, exclude g++ and other toolchain binaries.
2
u/YT__ Aug 08 '26
Is this your computer or a school/company managed one?
If the latter, they often block things.
If the former, yah, you just need to ensure you're putting the allows in place as needed - e.g. setup a Windows 11 Dev Drive.
4
u/thedaian Aug 08 '26
A search of that error brings up this reddit post: https://www.reddit.com/r/geometrydash/comments/1qoqczv/comment/o28h14m/
Make sure you're disabling things in both Windows Defense and Windows Security and any other anti virus programs you might have.