C++ NO OUTPUT....??

I have started a file practice.cpp under an empty project. I just wanted to test and see if i could make my first program and display the words "hello world" to the screen

here is what i wrote

#include<iostream>

using namespace std;

int main()

{

cout<<"Hello World"<<endl;

return 0;

}

now what happens is that it builds correct and when i hit F5 to run the program i get the error "UNABLE to start program C:\practice.exe the system cannot find the file specified"

can anyone help



Answer this question

C++ NO OUTPUT....??

  • ACorbs

    Hi!

    1. Are you sure there was no build errors
    2. Why it's in C:\practice.exe file Did you change properties of the project
    3. If you delete bin/obj folders, press Ctrl+Shift+B (Build) and then Ctrl+F5 or F5 - is the problem stays


  • Mike1900

    2) VS typically create exe in bin\debug or bin\release folders in your project folder. But in your first post there is C:\practice.exe, so I think may be you changed output path or play with other settings (especially Debug settings in project properties)

    3) when VS build project it use temporary obj folder (again in your project folder) and then put results to bin\debug folder (or bin\release). If you have some problems with compilation, then you must delete this folders (bin and obj) and try build and run again (this will make VS rebuild all stuff again). To delete them sometimes you need to close VS.



  • Fabio Mattiussi

    this is what im getting from my output window:

    ------ Skipped Build: Project: Project1, Configuration: Debug Win32 ------

    Project not selected to build for this solution configuration

    ========== Build: 0 succeeded or up-to-date, 0 failed, 1 skipped ==========


  • whytepaul

    and what about ideas 2 & 3

  • Bryan Morgan

    In "Build\Configuration manager" menu you can select "Active solution configuration" = Debug. In Debug configuration your application will be created with debugging information. You can also switch to Debug or Release configuration from toolbar (typically this dropdown box is somewhere in the center).

  • ImperfectTommy

    I dont think i understand what your ideas 2 & 3 Mean if you could explain possibly a little more in detail I havent used Visual C++ in a loooong time. I'm really sorry for being so newbish.....thank you though
  • KSchram

    Ok i think ive gotten to compile now when i press build but when i try to press F5 it now says....

    "Debugging information for 'practice.exe' cannot be found or does not match.Binary was not built with debug information."

    So i've taken a step forward but a little step backward because this in my way.

    Hope you can still help. but thank you though also for the help you have already given.


  • C++ NO OUTPUT....??