Program not run when clicking "Start Without Debugging" on CMake project using WSL2

Ayush Garg 1 Reputation point
2021-09-19T18:03:51.627+00:00

I am using Visual Studio 2019 to create a CMake project that runs WSL2 to compile my program. However, when I create the project and then try to start without debugging (Debug > Start Without Debugging), the program builds, and then it isn't run. I have also tried asking the user for input at the end like so:

char a;
std::cin >> a;

Still, no window appears.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,545 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
947 questions
{count} votes

1 answer

Sort by: Most helpful
  1. PengGe-MSFT 3,336 Reputation points
    2021-09-20T06:46:10.683+00:00

    Hi, @Ayush Garg

    Welcome to Microsoft Q&A!

    I cannot reproduce your issue on my side. You can try to repair Visual Studio before debugging.

    Sincerely,
    Peng
    *
    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments