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

JunYoungLee 161 Reputation points
Jul 9, 2022, 1:06 AM

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

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,780 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Minxin Yu 12,251 Reputation points Microsoft Vendor
    Jul 11, 2022, 1:44 AM

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