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

Process terminated with status 0

Started by Salient, April 15, 2011, 04:40:48 PM

Previous topic - Next topic

Salient

Well i started learning c++, writing my first hello world and  console doesn't even appear.

#include <iostream>
int main()
{
    std::cout << "Hello, World!" << std::endl;
    return 0;
}

And i get this in build log:

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)

adriano91

Do you use 'Build' or 'Build and run' option?

Maybe console just has been closed.

Try to build and run this code:

#include <iostream>
int main() {
  std::cout << "Hello, world" << std::endl;
  int n;
  std::cin >> n;
  return 0;
}

Salient

#2
I use build and run. And how much time should i wait for program to run? Since only this happen's

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.

adriano91

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'

Salient


stahta01

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++.
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]

MortenMacFly

Quote from: stahta01 on April 15, 2011, 05:40:42 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: [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]

Salient

What could be wrong with this code? It doesn't even have a loop.

#include <iostream>
int main() {
  std::cout << "Hello, world" << std::endl;
  int n;
  std::cin >> n;
  return 0;
}





stahta01

#8
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.
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]

Jenna

What's the type of the target you try to build ?

Ascyndaeon

#10
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:
#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...

stahta01

Quote from: 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.

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++.
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]

Ascyndaeon

Quote from: stahta01 on April 10, 2013, 01:59:20 AM
Quote from: 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.

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.

-------------- 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?

stahta01

Quote from: 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:
#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++.
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]

Ascyndaeon

Quote from: stahta01 on April 10, 2013, 02:08:56 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?