c++cvisual-studio-2010debuggingvisual-c++

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


I have a solution in C:\full path here\VS2010\blender.sln

This solution contains many projects(around 100). When I compile them, they all work fine. I can run them without any problem, and (quite) everything works (there are some bugs). One of the projects is ALL_BUILD, but it gives the same error if I try to debug INSTALL(another project). I'm compiling with RELWithDebInfo as configuration, and if I execute the program manually it works. It is outputted in C:\full path here\VS2010\bin\RelWithDebInfo

But if I try to run the compiler, it says

"Unable to start program C:\full path here\VS2010\RelWithDebInfo\ALL_BUILD Specified file cannot be found"

I tried to copy the compiled program into the path required by VS, but it raised the same error.

What should I do to solve this? Right now I set up cmake to generate also a mingw project and I compile it and debug it with gdb, but this is a really a slow and impractical workflow, and I would like to use the VS debugger.

I must say that if I compile with Debug as configuration, the program doesn't even start.

I'm using VS2010 Express on Win7 64bit

(This is a big open source program, so I don't know exactly whatever it does)


Solution

  • Guessing from the information I have, you're 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.