Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

How do I compile+BUILD+Run? Program flashes.

attatae
2012-03-23
2013-07-17
  • attatae
    attatae
    2012-03-23

    Hi!

    I am having an issue trying to run my program. Once I run, the black screen
    "cout" stuff just flashes and then goes away. I can hardly see what I was
    running.

    I have the following code I physically typed in:

    #include <iostream.h> //yes I know its old the .h but the program doesn't run even when i take it off.
    
    main()
    {
          cout << "Hello.";
          return (0);
    }
    

    I usually use Visual Studio 6 (at school) but I can't find the "Build" button
    here. I am just learning so don't know the phrase of equivalency that Dev
    might be using. I have tried Compile + Run, and "Compile & Run" but neither
    work. I can do it with VS6 so not sure what' up.

    Thanks in advance for any help!

     
  • Jim Pattee
    Jim Pattee
    2012-03-23

    Add this just before the return:
    system("pause");

     
  • attatae
    attatae
    2012-03-23

    Thanks jimp03! Is there a way to not have to do that, like with Visual Studio
    6? (I just build, I think.)

    Also now that I have got that taken care of, does anyone know how to find my
    errors WITHIN the source code? I try double-clicking the errors within
    "compile log" but it doesn't highlight source code (as far as I know) like in
    VS6. So its hard to know where exactly to change...

     
  • attatae
    attatae
    2012-03-23

    Hi nvm about the errors, I guess they are just in "Compiler." I was working
    within a project and I guess it was linking to some bad code and not rendering
    (or whatever) properly. I made a new source file outside of the project and
    that fixed it.

     
  • It's annoying sometimes to have something not work just because of a little
    mistake on the code. Happens to me so many times (and I'm talking about basic
    stuff).

     
  • kiCKYou
    kiCKYou
    2012-05-31

    Add these 2 lines before return statement:
    char response;
    std:cin >> response;

    I think system("pause"); does the same thing.

     
  • kiCKYou
    kiCKYou
    2012-05-31

    Sorry, system("pause"); gives you "Press any key to continue..."

     
  • Edward Rommy
    Edward Rommy
    2012-11-15

    Hi to all members and to the administrators of this forum, am really glad to be one of the member of this forum,and i need someone to help on how to use this fantastic software dev-c++.,i lean how to create a programm by myself and i belive together with your help in this forum,i will be able to create myown programm. Thanks to everyone of and have a nice time.

     
    • Joe Creaney
      Joe Creaney
      2012-11-15

      I would like to help but the compiler is not to hard to use.  Let me know what you need to know. 


      From: Edward Rommy edward10@users.sf.net
      To: [dev-cpp:discussion] 48211@discussion.dev-cpp.p.re.sf.net
      Sent: Wednesday, November 14, 2012 6:55 PM
      Subject: [dev-cpp:discussion] How do I compile+BUILD+Run? Program flashes.

      Hi to all members and to the administrators of this forum, am really glad to be one of the member of this forum,and i need someone to help on how to use this fantastic software dev-c++.,i lean how to create a programm by myself and i belive together with your help in this forum,i will be able to create myown programm. Thanks to everyone of and have a nice time.


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/dev-cpp/discussion/48211/
      To unsubscribe from further messages, please visit https://sourceforge.net/auth/prefs/

       
  • gina
    gina
    2013-07-17

    Post awaiting moderation.