none
System cannot find the file specified RRS feed

  • Question

  • I know this question has been asked many times, but the answers I've found haven't helped me. I am trying to start learning C++. It is my first day. I downloaded a couple compilers, but cannot get any to work. I am currently using Microsoft Visual C++ 2010 Express. I've copy and pasted a basic script:

    #include <iostream>
    
    int main()
    
    {
     std:cout << "hello" << std:endl;
    return 0;
    }
    
    

    I have copied a few different sample programs in an attempt to make this work. When I try to run the program I get the error: "Unable to start program 'C:\Users\danmer1\Desktop\Test project\Debug\Test project.exe'. The system cannot find the file specified.

    In the project folder on my desktop the Debug folder has a few items in it, but no executables. Why is it looking for a file that does not exist?

    I started this project as a Win32 Console.


    Friday, March 25, 2011 10:30 PM

Answers

  • Create new Win32 Console Application using Wizard and on Application Settings step don't check Empty project.

    Then try to compile. Works?


    Nikita Leontiev
    Friday, March 25, 2011 11:09 PM
  • Before you can run a program it must be built without errors.
    The code you posted has errors.

    std:cout << "hello" << std:endl;

    Should be:

    std::cout << "hello" << std::endl;

    - Wayne
    Friday, March 25, 2011 11:13 PM

All replies

  • Create new Win32 Console Application using Wizard and on Application Settings step don't check Empty project.

    Then try to compile. Works?


    Nikita Leontiev
    Friday, March 25, 2011 11:09 PM
  • Before you can run a program it must be built without errors.
    The code you posted has errors.

    std:cout << "hello" << std:endl;

    Should be:

    std::cout << "hello" << std::endl;

    - Wayne
    Friday, March 25, 2011 11:13 PM
  • This worked. Thank you! I swear I tried that before.... Maybe when I deleted the precompiled header i did something wrong.
    Friday, March 25, 2011 11:50 PM
  • Thanks for the catch.
    • Proposed as answer by yahyoooooh Saturday, April 9, 2011 9:02 PM
    • Unproposed as answer by yahyoooooh Saturday, April 9, 2011 9:03 PM
    Friday, March 25, 2011 11:50 PM
  • please,,, realy i wanna a sol. 4 this problem...

    when  debug:

    #include

    <iostream>

    using namespace

    std;

    int

    main ( ) {

    int

    m=7;

    while

    (m<42) {

    if

    (m%2==0)

    cout << (m/2) << endl;

    else

    cout << (m%5) << endl;

    m=m+3;

    }

    return

    0;

    }

    this massege will appear:

    "Unable to start program >>> The system cannot find the file specified.

     

     

     

    Saturday, April 9, 2011 9:08 PM
  • Before you can run a program it must be built without errors.
    The code you posted has errors.

    std:cout << "hello" << std:endl;

    Should be:

    std::cout << "hello" << std::endl;

    - Wayne

    Saturday, April 9, 2011 9:22 PM
  • Try test project
    Nikita Leontiev
    Saturday, April 9, 2011 9:56 PM