c++ - Visual Studio debugger error: Unable to start program Specified file cannot be found

c++ – Visual Studio debugger error: Unable to start program Specified file cannot be found

c++ – Visual Studio debugger error: Unable to start program Specified file cannot be found

Guessing from the information I have, youre not actually compiling the program, but trying to run it. That is, ALL_BUILD is set as your startup project. (It should be in a bold font, unlike the other projects in your solution) If you then try to run/debug, you will get the error you describe, because there is simply nothing to run.

The project is most likely generated via CMAKE and included in your Visual Studio solution. Set any of the projects that do generate a .exe as the startup project (by right-clicking on the project and selecting set as startup project) and you will most likely will be able to start those from within Visual Studio.

I had the same problem 🙂
Verify the Source code folder on the Solution Explorer, if it doesnt contain any source code file then :

Right click on Source code > Add > Existing Item > Choose the file You want to build and run.

Good luck 😉

c++ – Visual Studio debugger error: Unable to start program Specified file cannot be found

I think that what you have to check is:

  1. if the target EXE is correctly configured in the project settings (command, in the debugging tab). Since all individual projects run when you start debugging its well possible that only the debugging target for the ALL solution is missing, check which project is currently active (you can also select the debugger target by changing the active project).
  2. dependencies (DLLs) are also located at the target debugee directory or can be loaded (you can use the depends.exe tool for checking dependencies of an executable or DLL).

Related posts on c++  :

Leave a Reply

Your email address will not be published.