CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2009
    Posts
    80

    Exclamation Issue with Complier adding return lines that I don't want - Anyone ??

    hey,
    I recently switched from DevC++ to CodeBlocks.
    all my programs I compile now... I get a

    Process returned 0 (0X0) exicution time : 0.323 s
    press any key to continue.

    added to the end of the program. I understand that 0 means successful and it took 0.3 seconds to exicute the program,
    but I don't want it to give me the return line unless I ask it to...

    why does my new compiler do this ?

    anyone know how to shut that off ?

    thanks everyone : )

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Issue with Complier adding return lines that I don't want - Anyone ??

    Have you tried running the compiled program from the command line? That would tell you whether this is actually being built into your program, or is merely part of the wrapper they add when you run it through their interface.

  3. #3
    Join Date
    Feb 2009
    Posts
    80

    Re: Issue with Complier adding return lines that I don't want - Anyone ??

    hey,
    thanks... It did work fine without adding the return line when I ran it from the command prompt.

    So I guess that means it's part of the wrapper....

    anyone know how to change what goes into the wrapper so it will stop adding this line to my programs ?

    not a word about it in the included instructions for CodeBlocks environment.

    thanks : )

  4. #4
    Join Date
    Feb 2009
    Posts
    80

    Re: Issue with Complier adding return lines that I don't want - Anyone ??

    Got IT !!!

    for anyone else who runs into this....

    I found the setting that causes it to add a return line ( in codeblocks at least )

    go to:
    Project,
    Project Options,
    Click Build Targets Tab,
    under " select build target options " ( right side )
    UNCHECK the checkbox titled: Pause when exicution ends

    now it works as it should, and only returns 0 or 1 and execution time when asked to do so by the program.

    thanks for the tip-off Lindley !

    : )

  5. #5
    Join Date
    Feb 2009
    Posts
    80

    Re: Issue with Complier adding return lines that I don't want - Anyone ??

    I've discovered that it's always on for each new project in CodeBlocks.
    I guess the logic is so you don't have to add cin.get(); to keep the window open long enough to see the program run. Then you can use it to check each new function you add, and then you just uncheck that box when you're totally finished the program and want it to run normally.

    Cool.

  6. #6
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: Issue with Complier adding return lines that I don't want - Anyone ??

    Quote Originally Posted by Jeff++
    I guess the logic is so you don't have to add cin.get(); to keep the window open long enough to see the program run. Then you can use it to check each new function you add, and then you just uncheck that box when you're totally finished the program and want it to run normally.
    Yes, or you can run it from the command prompt yourself, in which case the IDE settings won't matter since you are not running it through the IDE.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured