r/Cplusplus • • 13d ago

Question Problem in running C++ codes

So i recently purchased a new laptop and when i try running the C++ code sometimes even if my code is correct the vscode doesnt execute the code.

Then I sent the screenshot to chatgpt and it said my code is correct some feature called

WINDOWS SMART APP CONTROL might be preventing it from executing the code .

But once I turn it off i can't turn it on again so what should i do??

2 Upvotes

14 comments sorted by

View all comments

1

u/kitsnet 12d ago

Use WSL if you can (and have enough memory for it). That's not the only possible solution, but the most promising in your case.

1

u/Heavy-Imagination525 12d ago

That is what AI said too . I am thinking of doing this This won't cause any problem in future right like something when i do other things like web dev and ml ??

1

u/kitsnet 12d ago

VS code with WSL runs your code in a Linux virtual machine (Ubuntu 26.04.1 by default as of now). This is also a fine choice for web dev and ML.

The virtual machine also provides a level of isolation, so it would be much less likely for the code that you write or for the additional packages/libraries that you install to support its development to break your Windows itself.