r/Cplusplus • • 21h 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??

0 Upvotes

9 comments sorted by

•

u/AutoModerator 21h ago

Thank you for your contribution to the C++ community!

As you're asking a question or seeking homework help, we would like to remind you of Rule 3 - Good Faith Help Requests & Homework.

  • When posting a question or homework help request, you must explain your good faith efforts to resolve the problem or complete the assignment on your own. Low-effort questions will be removed.
  • Members of this subreddit are happy to help give you a nudge in the right direction. However, we will not do your homework for you, make apps for you, etc.
  • Homework help posts must be flaired with Homework.

~ CPlusPlus Moderation Team


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Polarisu_san 20h ago

did u try running it plainly with g++ commands first?

2

u/One_Worldliness_1130 20h ago

programing on windows can be a pain wait till you get to libraries CMake sometimes makes that easier but i found just compiling in the terminal easier on windows for the time i did use windows for it you can sometimes get windows to find the libraries that way as well good luck

cause winows wants you to use vs studio despite owning all other ide's almost its sad

1

u/KlutzyCompetition937 20h ago

Whitelist vs code in windows defender

1

u/Discordbothost 18h ago

I'd leave Smart App Control on for now. When it fails, is there an .exe at the path in launch.json's program field? If so, what exact message appears when you run that .exe?

1

u/agfitzp 15h ago

I don’t know who keeps telling the newbies to use VSCode for C++.

If you’re on Windows use Visual Studio, there’s a free version for non-commercial use.

If you’re on Linux use CLion, also a free version for non-commercial use.

1

u/Business-Weather-217 10h ago

Install the penguin

0

u/LazySapiens 5h ago

Create a DevDrive on Windows. Use that drive for all of your codes.