visual studio – The system cannot find the file specified when running C++ program

visual studio – The system cannot find the file specified when running C++ program

This is a first step for somebody that is a beginner. Same thing happened to me:

Look in the Solution Explorer box to the left. Make sure that there is actually a .cpp file there. You can do the same by looking the .cpp file where the .sln file for the project is stored. If there is not one, then you will get that error.

When adding a cpp file you want to use the Add new item icon. (top left with a gold star on it, hover over it to see the name) For some reason Ctrl+N does not actually add a .cpp file to the project.

Encountered the same issue, after downloading a project, in debug mode. Searched for hours without any luck. Following resolved my problem;

Project Properties -> Linker -> Output file -> $(OutDir)$(TargetName)$(TargetExt)

It was previously pointing to a folder that MSVS wasnt running from whilst debugging mode.

EDIT: soon as I posted this I came across: unable to start program.exe the system cannot find the file specified vs2008 which explains the same thing.

visual studio – The system cannot find the file specified when running C++ program

I have recently not used VS 2010.

Does your application really build correctly?
To get more control in VS 2010 C++ Express, you can check menu item Expert Settings under Tools>Settings to get a Build menu.
After clicking Build->Build Solution (or Rebuild), you may verify in Output window (View->Outout), if your application is compiling and linking correctly.

Sources :

Hope it helps.

Leave a Reply

Your email address will not be published.