Cannot open source file error when using c++ in visual studio 2022 More than 400

JunYoungLee 161 Reputation points
2022-07-09T01:06:19.603+00:00

I am new to c++. I tried to output hello world and create and run a c++ project in visual studio 2022, but I get an error Cannot open source file.
I searched the internet and installed c++ windows sdk, but it doesn't work. I am attaching my screen. Any help would be appreciated.

218970-1.png219086-2.png219077-3.png

Developer technologies | C++
Developer technologies | 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.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Minxin Yu 13,506 Reputation points Microsoft External Staff
    2022-07-11T01:44:34.677+00:00

    Hi, @JunYoungLee

    Try to repair Visual Studio.
    Install SDK version in the picture and select the latest SDK Version :
    219343-image.png
    219275-image.png

    Best regards,

    Minxin Yu


    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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.