When I write a C++program in visual studio and then click start execution, it shows that it is not a valid Win32 application

宏程 胡 0 Reputation points
2024-02-08T04:43:04.8566667+00:00

User's image

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,448 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 33,551 Reputation points Microsoft External Staff
    2024-02-08T07:10:49.6866667+00:00

    Hello @宏程 胡,

    Welcome to Microsoft Q&A forum.

    What type of project are you using? Is it a Win32 application? Try to create a new project, and directly run it, will the same error appear?

    If you have multiple projects in your solution, please make sure that the project which you want to run has been correctly set as startup project(right-click your project => Set as Startup Project).

    Besides, which version of VS and Windows OS are you using?

    Best Regards,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.