Code::Blocks Forums

User forums => Help => Topic started by: Salient on April 15, 2011, 04:40:48 pm

Title: Process terminated with status 0
Post by: Salient 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
#include <iostream>
int main()
{
    std::cout << "Hello, World!" << std::endl;
    return 0;
}
And i get this in build log:
Code
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)
Title: Re: Process terminated with status 0
Post by: adriano91 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
#include <iostream>
int main() {
  std::cout << "Hello, world" << std::endl;
  int n;
  std::cin >> n;
  return 0;
}
Title: Re: Process terminated with status 0
Post by: Salient 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
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.
Title: Re: Process terminated with status 0
Post by: adriano91 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'
Title: Re: Process terminated with status 0
Post by: Salient on April 15, 2011, 05:30:13 pm
It's already ticked.
Title: Re: Process terminated with status 0
Post by: stahta01 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.
Title: Re: Process terminated with status 0
Post by: MortenMacFly 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.
Title: Re: Process terminated with status 0
Post by: Salient on April 15, 2011, 06:19:12 pm
What could be wrong with this code? It doesn't even have a loop.
Code
#include <iostream>
int main() {
  std::cout << "Hello, world" << std::endl;
  int n;
  std::cin >> n;
  return 0;
}



Title: Re: Process terminated with status 0
Post by: stahta01 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.
Title: Re: Process terminated with status 0
Post by: Jenna on April 15, 2011, 07:56:49 pm
What's the type of the target you try to build ?
Title: Re: Process terminated with status 0
Post by: Ascyndaeon 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
#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...
Title: Re: Process terminated with status 0
Post by: stahta01 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 (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

Tim S.
Title: Re: Process terminated with status 0
Post by: Ascyndaeon 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 (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

Tim S.

Code
-------------- 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?
Title: Re: Process terminated with status 0
Post by: stahta01 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
#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.
Title: Re: Process terminated with status 0
Post by: Ascyndaeon 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?
Title: Re: Process terminated with status 0
Post by: stahta01 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.
Title: Re: Process terminated with status 0
Post by: Ascyndaeon 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.
Title: Re: Process terminated with status 0
Post by: stefanos_ 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.