• Register
100 points
7 4

As the error itself explains that we are not able to start the program because the system cannot find the file. Errors of this kind always occur due to adding the file to the project in the wrong way either by mistake or other way. Microsoft Visual has an annoying issue of not adding files to the project if we add via the file menu of the Visual C++, god knows why? And if we try to compile, we will end up receiving errors.

Solution

Although this error has the simplest solution, we just have to add our .cpp file to the source folders in the project yourself.
There are two simple methods to add files in the source folder of the project.
 
  • Method 1

 

  1. Open project
  2. Right click on the “source files” folder
  3. Select add
  4. Hit new item
  • Method 2

 

  1. Add files via project menu, go to project
  2. Select add new items
  3. Choose your cpp file
  4. Hit add

You can use either of them to resolve the error. After doing this you can successfully compile and run your project file.

Hope this will help.
 

100 points
7 4