none
The System cannot find the file specified RRS feed

  • Question

  • #include <iostream>
    #include "conio.h"
    using namespace std;
    void main(){
    cout << "Hello World" << endl;
    _getch() 
    }
    i used the following code and when i press start debugging i get the following error
     
    Friday, November 11, 2011 2:25 PM

Answers

  • In the code you pasted here, a ; is missing after _getch(), by this is maybe a copy/paste error.

    It is strange you have a cpp file in "linker tab". How did that happen? Are you talking about the "Project / Properties" dialog box, "linker / General" tab, in the "output file" field? This is where you specify the name of the EXE filename you build. 

    This is one of the two filenames SimonRev talks about are. The other one, the filename which is run when you start debugging, is in the same Project/Properties dialogbox, but in the "Debugging" tab, in "Command" field.

    Those two names must match: the compiler and the linker build a file, and the debugger runs this file.

     

    • Marked as answer by Nabeel Hassan Saturday, November 12, 2011 5:30 AM
    Saturday, November 12, 2011 1:24 AM

All replies

  • Does the file listed in the dialog exist? (Presumably not).  Likely you have told Visual Studio to build one file the linker tab of your project settings, but in the debug tab of your project settings you told it to execute another one.  You need to make the two files match.
    Friday, November 11, 2011 2:45 PM
  • the address in linker tab
    c:\users\admin\documents\visual studio 2010\projects\hello youtube\hello youtube\hey.cpp

    btw how can i match the two files 
    Friday, November 11, 2011 3:02 PM
  • In the code you pasted here, a ; is missing after _getch(), by this is maybe a copy/paste error.

    It is strange you have a cpp file in "linker tab". How did that happen? Are you talking about the "Project / Properties" dialog box, "linker / General" tab, in the "output file" field? This is where you specify the name of the EXE filename you build. 

    This is one of the two filenames SimonRev talks about are. The other one, the filename which is run when you start debugging, is in the same Project/Properties dialogbox, but in the "Debugging" tab, in "Command" field.

    Those two names must match: the compiler and the linker build a file, and the debugger runs this file.

     

    • Marked as answer by Nabeel Hassan Saturday, November 12, 2011 5:30 AM
    Saturday, November 12, 2011 1:24 AM