Code::Blocks Forums

User forums => Help => Topic started by: unasimulated on January 13, 2016, 02:15:28 am

Title: process terminated with status 12
Post by: unasimulated on January 13, 2016, 02:15:28 am
hi, very new to C and I tried this program and got a process terminated with status 12 error, what am I missing?

/*print a message on the screen*/
#include <stdio.h>
main ()
{
    printf("work");
    printf("just once!\n");
    return 0;
}
Title: Re: process terminated with status 12
Post by: raynebc on January 13, 2016, 09:07:40 am
http://forums.codeblocks.org/index.php?topic=17793.0

You didn't define main as having a return value so the compiler may have optimized away that return 0 statement and I'm guessing 12 is the return value of your last printf() call and that gets returned implicitly.
Title: Re: process terminated with status 12
Post by: unasimulated on January 13, 2016, 11:52:25 pm
OK, so I tried this and still no luck, can see anything wrong but still get the same result, sorry for being a pain but I can't see anything missing

/*print a message on the screen*/
#include <stdio.h>

int main(void)
{
    printf ("work");
    printf ("just once!");
    return 0;
}
Title: Re: process terminated with status 12
Post by: raynebc on January 14, 2016, 12:23:15 am
Could be something like your antivirus software interfering.
Title: Re: process terminated with status 12
Post by: oBFusCATed on January 14, 2016, 01:04:10 am
Have you tried to use the debugger?
Title: Re: process terminated with status 12
Post by: unasimulated on January 14, 2016, 03:01:10 am
debugger shows nothing
thanks for the idea
Title: Re: process terminated with status 12
Post by: Jenna on January 14, 2016, 05:57:03 am
Please provide the "Build log" of a full rebuild (clean and build).
And give some more information, at least C::B version, compiler and version and OS and version.
Title: Re: process terminated with status 12
Post by: unasimulated on January 18, 2016, 01:12:00 am
sorry for the delay in getting back to this
from build log tab at bottom of window:
Nothing to be done (all items are up-to-date).

Checking for existence: C:\Users\home\Desktop\c\first\test.exe
Executing: C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe "C:\Users\home\Desktop\c\first\test.exe" (in C:\Users\home\Desktop\c\first)
Process terminated with status 12 (0 minute(s), 20 second(s))

From setting: GDB/CDB debugger, GNu GCC Complier, CB version 13.12

hope this is what you wanted and thank you for the help
Title: Re: process terminated with status 12
Post by: stahta01 on January 18, 2016, 02:20:44 am
hope this is what you wanted ...

Please read and then post a full rebuild log!
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

Edit: Jens also wanted the Compiler version.

Tim S.
Title: Re: process terminated with status 12
Post by: unasimulated on January 18, 2016, 02:53:54 am
I know you are trying to help but that did not help, I don't know where the build log is if it is not in the tab as that is what the FAQ sheet you pointed me asked for
or where to find the compiler version
one thing I did notice is when I try to run it, a popup window comes up saying "that it seems as if this file has not been built yet, d you want to build it now"
but it seems to build it when I run build, it has a green bar down the side of the text window
did this not install properly
I am using windows 10
Title: Re: process terminated with status 12
Post by: stahta01 on January 18, 2016, 03:05:39 am
"Clean" means to remove the prior built objects!
Use the "Build" menu, select the option "clean" in order to clean the project.

Tim S.


Title: Re: process terminated with status 12
Post by: unasimulated on January 18, 2016, 03:36:56 am
I have started with a empty file each time and the clean is greyed out in the build menu either with a fresh build or when I open one I saved?
Title: Re: process terminated with status 12
Post by: BlueHazzard on January 18, 2016, 01:50:36 pm
I have started with a empty file each time and the clean is greyed out in the build menu either with a fresh build or when I open one I saved?

The proper use of codeblocks is not to use only files, but to use projects... I don't know if the clean and build steps work with a single file (i would suggest to even deactivate the compile button unless a project is loaded....)

So, the proper utilization of c::b is to create a project and add your c files there. Then you should be able to make a clean rebuild...
 

OT (i write this here, so i can link to this answer from other questions, because it gets asked a lot):
You may ask why c::b does needs a project, even if you only want to use one file? Well, if you only want to use one file, why do you need a IDE anyway
? Simply use the command line and you are way faster...  Codeblocks stores a lot information in the project, like compiler options, layout settings, dependency, debugger settings and so on. As soon as you are going to debug your application you need the project file. It is not really a problem to create a project instead of a cpp file (the wizard will do all the work for you), simply go File->New->Project, choose "console Application" and follow the shown steps....


I know you are trying to help but that did not help, I don't know where the build log is if it is not in the tab as that is what the FAQ sheet you pointed me asked for
or where to find the compiler version
There are two build information tabs in the log view: The "build messages" and the "Build log".

where to find the compiler version
This is quite tricky to get from within c::b (we should provide some info tab, where this is written, or incorporate it in the build log...)  The easiest way to get it is from the command line:
Start->Run->cmd.exe->enter
then a black window will pop up. There you have to enter "gcc -v" without quotes and post the output..

greetings
Title: Re: process terminated with status 12
Post by: Jenna on January 18, 2016, 02:22:27 pm
[snip]
There you have to enter "gcc -v" without quotes and post the output..
[/snip]

The correct parameter is "--version", "-v" gives some more (in most cases unrelated and sometimes probably confusing) output (but also shows the version):

Quote
-v Print (on standard error output) the commands executed to run the stages of compilation.  Also print the version number of the compiler driver program and of the preprocessor and the compiler proper.

Quote
--version Display the version number and copyrights of the invoked GCC.
Title: Re: process terminated with status 12
Post by: unasimulated on January 19, 2016, 04:12:35 am
thank you for your patient, last programming I did was with pascal if that tells you anything
GCC version is 3.4.2 and it was already in my xilinx vivado directory
got as far as a project but unfortunately that was it, how do I get a text window open to enter the code?
Sorry, looked for a user guide but couldn't find one
Title: Re: process terminated with status 12
Post by: BlueHazzard on January 19, 2016, 11:32:06 am
got as far as a project but unfortunately that was it, how do I get a text window open to enter the code?
Sorry, looked for a user guide but couldn't find one
First time any ide? On your left side of the window there is the "Projects"  window. There you can see A Workspace with your Project in it. There you have to open the .c(pp) file.
Search the web, there are tons of tutorials...
https://www.youtube.com/watch?v=e1YafrxYOWw
http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/codeblocks-instructions.pdf
Title: Re: process terminated with status 12
Post by: unasimulated on January 19, 2016, 11:39:49 pm
sorry, should have thought of that, just getting frustrated as I have not been able to solve what I suspect is something simple
will post once I get the project thing figured
thank you for your help
Title: Re: process terminated with status 12
Post by: unasimulated on January 20, 2016, 01:44:12 am
works in a project, guess that is all it was, the book  C programming Absolute beginners guide is not very good BTW
Title: Re: process terminated with status 12
Post by: unasimulated on January 20, 2016, 02:40:15 am
thank you all for your help