0

i am new and i was trying to learn c++, so i open my visual studio 2019, then create a new console application and click the run button.

This is the autogenerated code:

#include <iostream>
int main()
{
     std::cout << "Hello World!\n";
}

enter image description here

any idea?

VinzeG
  • 11
  • 4
  • Does this answer your question? ["The system cannot find the file specified" when running C++ program](https://stackoverflow.com/questions/16511925/the-system-cannot-find-the-file-specified-when-running-c-program) – sweak Feb 28 '21 at 00:36
  • If the compile competed successfully perhaps your antivirus deleted or quarantined the your executable. – drescherjm Feb 28 '21 at 01:38
  • Please post the error message verbatim. The title says *"MYPATH.exe"*, while the wizard-generated project is called *"ConsoleApplication002"* which, by default, produces a binary called *"ConsoleApplication002.exe"*. – IInspectable Feb 28 '21 at 08:53
  • No, that does not answer the question, i already check the other post before make this one. – VinzeG Feb 28 '21 at 19:54
  • the path is ok, i change that to MYPATH just to do not copy all my path. – VinzeG Feb 28 '21 at 19:55

1 Answers1

0

To fix the error, i go to Tools > Get Tool And Features... enter image description here

Then i installed Windows 10 SDK (10.0.19041.0) enter image description here

and now my program works! Someone know the reason why the SDK is not installed by default?

VinzeG
  • 11
  • 4
  • You didn't mention that there were any compile errors. I guess we should have asked. Without the SDK installed there should have been around 400 errors building that would have shown up in the Errors List and the Output Tab. – drescherjm Mar 01 '21 at 01:59
  • I am glad you have got your solution and thanks for your sharing, I would appreciate it if you mark them as answer and this will be beneficial to other community. – Barrnet Chou Mar 03 '21 at 05:34