News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Problem with executing compiled program. Please help.

Started by cshong, June 07, 2008, 07:04:03 AM

Previous topic - Next topic

cshong

The following problem does not occured in Microsoft Visual C++ IDE.

I'm using Code::Blocks 8.02.

I use 'int main()' to declare the main function. I had input 'return 0' at the end of the main() function.

When I try to execute my compiled program with Code::Blocks, my program show "Process returned 0 (0x0) execution time....". I don't want this statement to be displayed.

Can I solve this problem without modifying my source code?

Ceniza

Your executable doesn't show that. It's a program Code::Blocks uses to run your program through that displays that message. You can remove that behavior by clicking on Project -> Properties... -> [Build targets]. Select your target and _uncheck_ Pause when execution ends. AFAIK there's no way to disable that behavior when compiling and running a single file (no Project).

cshong

Quote from: Ceniza on June 07, 2008, 08:24:56 AM
Your executable doesn't show that. It's a program Code::Blocks uses to run your program through that displays that message. You can remove that behavior by clicking on Project -> Properties... -> [Build targets]. Select your target and _uncheck_ Pause when execution ends. AFAIK there's no way to disable that behavior when compiling and running a single file (no Project).

Thanks for your reply. But your solution will disable "Press any key to continue". I want the program to ONLY DISPLAY "Press any key to.." but NOT DISPLAY "Process returned 0 (0x0) execution...." at the end of execution.

I'm scared that my lecturer will deduct my marks if he see "Process returned 0 (0x0) execution...." in the screenshot of my program, and I must run it inside the IDE.

Am I able to do this without modifying my source code?

MortenMacFly

Quote from: cshong on June 07, 2008, 03:21:09 PM
Am I able to do this without modifying my source code?
Why don't you just launch your application from the command line / prompt?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

cshong

Quote from: MortenMacFly on June 07, 2008, 04:23:14 PM
Quote from: cshong on June 07, 2008, 03:21:09 PM
Am I able to do this without modifying my source code?
Why don't you just launch your application from the command line / prompt?!

Thanks for your suggestion. I appreciate it.

cybernike

I actually want the opposite. Why when I run a compiled program in code::blocks, it doesn't show the execution time? Where can I enable that?

Deschamps

#6
Quote from: cybernike on June 21, 2008, 10:05:45 AM
I actually want the opposite. Why when I run a compiled program in code::blocks, it doesn't show the execution time? Where can I enable that?

If your run your app inside C::B, then you'll see the total execution time (i.e. when you close your app) in the Build log tab (if you don't have the Logs panel visible, you could see it pressing F2 or using menu View -> Logs). If you're looking for a timing during execution, then I don't know the answer :)

Regards.
Those who were seen dancing were thought to be insane by those who could not hear the music

cybernike

I am actually looking for something like this "Process returned 0 (0x0)   execution time : 0.055 s" at the end of execution for a console program.

My windows C::B shows that, but not my Linux version. Any idea?


rynee

Well it's been about 5 years since this thread. Is there any way to disable this
QuoteProcess returned 0 (0x0)   execution time : 0.987 s
Press any key to continue.
output as of 2013?

BlueHazzard

first of all, this is grave desecration. This thread is more then five years old....

second:
Quote from: Ceniza on June 07, 2008, 08:24:56 AM
Your executable doesn't show that. It's a program Code::Blocks uses to run your program through that displays that message. You can remove that behavior by clicking on Project -> Properties... -> [Build targets]. Select your target and _uncheck_ Pause when execution ends. AFAIK there's no way to disable that behavior when compiling and running a single file (no Project).

rynee

QuoteAFAIK there's no way to disable that behavior when compiling and running a single file (no Project).

Right, so am I to assume that in the last 5 years no one has fixed this yet?

stahta01

#11
Quote from: rynee on October 08, 2013, 12:04:33 AM
QuoteAFAIK there's no way to disable that behavior when compiling and running a single file (no Project).

Right, so am I to assume that in the last 5 years no one has fixed this yet?

Right, so I am to assume you are a idiot, who can NOT create a CB project or use a makefile.
Or use, the tool menu or the Toolplus plugin.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]