none
VS Community 2015 C++ Unable to start program. The system cannot find the file specified.

    Question

  • For the last year or so, I've been using VS Community 2015 extensively for web dev and the occasional bit of C# and just come to do some C++ (cpnsole app).

    When I try to run the following code (devilish hard, I know):

    #include <iostream>
    using namespace std;
    
    int main() {
      cout << "Hello World";
      return 0;
    }

    I get the following error:

    -------------------------------------------------------------------------------
    Unable to start program 'C:\Users\carlb\Documents\Visual Studio 2015\Projects\LiftCount\Debug\LiftCount.exe'.

    The system cannot find the file specified.
    -------------------------------------------------------------------------------

    The code compiles with no errors but there is no .exe at the file location. I've tried deleting .db, suo, restarting, rebuilding and cleaning.

    Help! And TIA!





    • Edited by Carl Bateman Tuesday, February 28, 2017 5:25 PM clarification
    Tuesday, February 28, 2017 5:21 PM

Answers

  • The main.cpp "Item Type" property was set to

    "Does not participate in build"

    C#*$+ knows why. Setting it to 

    "C/C++ compiler"

    Seems to have fixed the problem.

    • Marked as answer by Carl Bateman Tuesday, February 28, 2017 8:47 PM
    Tuesday, February 28, 2017 8:47 PM

All replies

  • Right-click on your project, click Rebuild and see if it works. Check the Output window to see if an .exe file has been created or to see if you have any errors.

    Tuesday, February 28, 2017 5:47 PM
  • The main.cpp "Item Type" property was set to

    "Does not participate in build"

    C#*$+ knows why. Setting it to 

    "C/C++ compiler"

    Seems to have fixed the problem.

    • Marked as answer by Carl Bateman Tuesday, February 28, 2017 8:47 PM
    Tuesday, February 28, 2017 8:47 PM
  • I'd tried that (outout calimed success but the file wasn't listed).

    Fixed now (see above), thanks for trying.

    Tuesday, February 28, 2017 8:49 PM