Author Topic: Process terminated with status 0  (Read 27050 times)

Offline Salient

  • Single posting newcomer
  • *
  • Posts: 4
Process terminated with status 0
« on: April 15, 2011, 04:40:48 pm »
Well i started learning c++, writing my first hello world and  console doesn't even appear.
Code: [Select]
#include <iostream>
int main()
{
    std::cout << "Hello, World!" << std::endl;
    return 0;
}
And i get this in build log:
Code: [Select]
Checking for existence: C:\Users\Salient\Desktop\Pamokos\Pirmas chapteris\bin\Debug\Pirmas chapteris.exe
Executing: "C:\Users\Salient\Desktop\Pamokos\Pirmas chapteris\bin\Debug\Pirmas chapteris.exe"  (in C:\Users\Salient\Desktop\Pamokos\Pirmas chapteris\.)
Process terminated with status 0 (0 minutes, 0 seconds)

Offline adriano91

  • Single posting newcomer
  • *
  • Posts: 4
Re: Process terminated with status 0
« Reply #1 on: April 15, 2011, 04:53:23 pm »
Do you use 'Build' or 'Build and run' option?

Maybe console just has been closed.

Try to build and run this code:
Code: [Select]
#include <iostream>
int main() {
  std::cout << "Hello, world" << std::endl;
  int n;
  std::cin >> n;
  return 0;
}

Offline Salient

  • Single posting newcomer
  • *
  • Posts: 4
Re: Process terminated with status 0
« Reply #2 on: April 15, 2011, 05:02:35 pm »
I use build and run. And how much time should i wait for program to run? Since only this happen's
Code: [Select]
Checking for existence: C:\Users\Salient\Desktop\Pamokos\Pirmas chapteris\bin\Debug\Pirmas chapteris.exe
Executing: "C:\Users\Salient\Desktop\Pamokos\Pirmas chapteris\bin\Debug\Pirmas chapteris.exe"  (in C:\Users\Salient\Desktop\Pamokos\Pirmas chapteris\.)
i waited for about 2 minutes but nothing happens. Oh and in task mananger process tab i can see pirmas chapteris.exe is running but i can't see the console.
« Last Edit: April 15, 2011, 05:05:47 pm by Salient »

Offline adriano91

  • Single posting newcomer
  • *
  • Posts: 4
Re: Process terminated with status 0
« Reply #3 on: April 15, 2011, 05:07:56 pm »
You don't have to wait so long, it should appear in 2-5 sec.

Try this: Menu Project -> Properties... -> tab 'Build targets' -> tick 'Pause when execution ends'

Offline Salient

  • Single posting newcomer
  • *
  • Posts: 4
Re: Process terminated with status 0
« Reply #4 on: April 15, 2011, 05:30:13 pm »
It's already ticked.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6512
    • My Best Post
Re: Process terminated with status 0
« Reply #5 on: April 15, 2011, 05:40:42 pm »
Try to never use spaces or special characters in the path when doing programing!
Never USE a space in an exe filename!!!!!!!!!!!!!

Note: To CB Devs, should CB allow a space in the exe filename?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9490
Re: Process terminated with status 0
« Reply #6 on: April 15, 2011, 05:44:46 pm »
Never USE a space in an exe filename!!!!!!!!!!!!!
Why? I do it very often and it works just fine.
[I wouldn't do it though if I wouldn't have to...]

BTW: @Salient: I guess the issue here is with your code. If you have an endless loop in you app this would explain such a behaviour.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Salient

  • Single posting newcomer
  • *
  • Posts: 4
Re: Process terminated with status 0
« Reply #7 on: April 15, 2011, 06:19:12 pm »
What could be wrong with this code? It doesn't even have a loop.
Code: [Select]
#include <iostream>
int main() {
  std::cout << "Hello, world" << std::endl;
  int n;
  std::cin >> n;
  return 0;
}




Offline stahta01

  • Lives here!
  • ****
  • Posts: 6512
    • My Best Post
Re: Process terminated with status 0
« Reply #8 on: April 15, 2011, 07:33:59 pm »
Turn on Full Compiler Logging and do a Full Rebuild and possible you have a compiler error that will show up in the build log.

See MortenMacFly Signature for Compiler logging.
Or, Wiki FAQ http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Tim S.
« Last Edit: April 15, 2011, 07:52:02 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Process terminated with status 0
« Reply #9 on: April 15, 2011, 07:56:49 pm »
What's the type of the target you try to build ?

Offline Ascyndaeon

  • Single posting newcomer
  • *
  • Posts: 4
Re: Process terminated with status 0
« Reply #10 on: April 10, 2013, 01:45:08 am »
I'm having this same problem. I'm just following "C++ All In One For Dummies (2nd edition)" (because I'm a beginner, haha).
I'm using Code::Blocks 8.02 and the book told me to put this code in:
Code: [Select]
#include <iostream>

using namespace std;

int main()
{
     cout << "Hello, I am your computer talking." << endl;
     return 0;
}

I did this, then clicked Build->Build and it came up with this message.
"Process terminated with status 0 (0 minutes, 0 seconds)"
"0 errors, 0 warnings"
So I'm wondering why it would say there are no errors but still gives me the "terminated with status 0"? I went and ran it and it seemed to work, but its execution time was 0.062 s instead of 0.015 s (which I'm worried that if I'm writing bigger programs, they will compile slower with this problem?)...it's just strange that that would happen...
« Last Edit: April 10, 2013, 02:01:05 am by Ascyndaeon »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6512
    • My Best Post
Re: Process terminated with status 0
« Reply #11 on: April 10, 2013, 01:59:20 am »
Turn on Full Compiler Logging and do a Full Rebuild and possible you have a compiler error that will show up in the build log.

See MortenMacFly Signature for Compiler logging.
Or, Wiki FAQ http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Tim S.

I ask for the last time; if you do NOT post the "build log", then do NOT expect any help from me!

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Ascyndaeon

  • Single posting newcomer
  • *
  • Posts: 4
Re: Process terminated with status 0
« Reply #12 on: April 10, 2013, 02:05:54 am »
Turn on Full Compiler Logging and do a Full Rebuild and possible you have a compiler error that will show up in the build log.

See MortenMacFly Signature for Compiler logging.
Or, Wiki FAQ http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Tim S.

I ask for the last time; if you do NOT post the "build log", then do NOT expect any help from me!

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Tim S.

Code: [Select]
-------------- Build: Debug in SayHello ---------------

mingw32-g++.exe -Wall -fexceptions  -g     -c C:\CPP_Projects\SayHello\main.cpp -o obj\Debug\main.o
mingw32-g++.exe  -o bin\Debug\SayHello.exe obj\Debug\main.o   
Output size is 57.26 KB
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings

...is this what you wanted?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6512
    • My Best Post
Re: Process terminated with status 0
« Reply #13 on: April 10, 2013, 02:08:56 am »
I'm having this same problem. I'm just following "C++ All In One For Dummies (2nd edition)" (because I'm a beginner, haha).
I'm using Code::Blocks 8.02 and the book told me to put this code in:
Code: [Select]
#include <iostream>

using namespace std;

int main()
{
     cout << "Hello, I am your computer talking." << endl;
     return 0;
}

I did this, then clicked Build->Build and it came up with this message.
"Process terminated with status 0 (0 minutes, 0 seconds)"
"0 errors, 0 warnings"
So I'm wondering why it would say there are no errors but still gives me the "terminated with status 0"? I went and ran it and it seemed to work, but its execution time was 0.062 s instead of 0.015 s (which I'm worried that if I'm writing bigger programs, they will compile slower with this problem?)...it's just strange that that would happen...

The time is likely different just based on what else is running on your computer; the returned value of 0 is normal for running a program.

There is NO indication that you have a problem.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Ascyndaeon

  • Single posting newcomer
  • *
  • Posts: 4
Re: Process terminated with status 0
« Reply #14 on: April 10, 2013, 02:13:26 am »
The time is likely different just based on what else is running on your computer; the returned value of 0 is normal for running a program.

There is NO indication that you have a problem.

Tim S.

So then...this "Process terminated with status 0" is really just meaningless, as long as it turns no errors or warnings?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6512
    • My Best Post
Re: Process terminated with status 0
« Reply #15 on: April 10, 2013, 02:19:15 am »
The time is likely different just based on what else is running on your computer; the returned value of 0 is normal for running a program.

There is NO indication that you have a problem.

Tim S.

So then...this "Process terminated with status 0" is really just meaningless, as long as it turns no errors or warnings?

Zero is the normal returned value; if it is NOT zero it typically means something is wrong.

So if "Process terminated with status -1" likely means your program returned -1 in it.
Look up the exit function and return statement for more info.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Ascyndaeon

  • Single posting newcomer
  • *
  • Posts: 4
Re: Process terminated with status 0
« Reply #16 on: April 10, 2013, 02:21:07 am »
Zero is the normal returned value; if it is NOT zero it typically means something is wrong.

So if "Process terminated with status -1" likely means your program returned -1 in it.
Look up the exit function and return statement for more info.

Tim S.

Oh, okay. Thanks.

stefanos_

  • Guest
Re: Process terminated with status 0
« Reply #17 on: April 10, 2013, 08:37:39 am »
If you are under Windows 7 with a firewall and or an antivirus installed, check your antivirus settings; you might have set them at high security and block executables at random. I have had an issue like this in one my PCs at my labs where I work as IT Tech Support.