Author Topic: process terminated with status 12  (Read 10964 times)

Offline unasimulated

  • Multiple posting newcomer
  • *
  • Posts: 10
process terminated with status 12
« 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;
}

Offline raynebc

  • Almost regular
  • **
  • Posts: 217
Re: process terminated with status 12
« Reply #1 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.

Offline unasimulated

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: process terminated with status 12
« Reply #2 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;
}

Offline raynebc

  • Almost regular
  • **
  • Posts: 217
Re: process terminated with status 12
« Reply #3 on: January 14, 2016, 12:23:15 am »
Could be something like your antivirus software interfering.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: process terminated with status 12
« Reply #4 on: January 14, 2016, 01:04:10 am »
Have you tried to use the debugger?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline unasimulated

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: process terminated with status 12
« Reply #5 on: January 14, 2016, 03:01:10 am »
debugger shows nothing
thanks for the idea

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: process terminated with status 12
« Reply #6 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.

Offline unasimulated

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: process terminated with status 12
« Reply #7 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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: process terminated with status 12
« Reply #8 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

Edit: Jens also wanted the Compiler version.

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

Offline unasimulated

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: process terminated with status 12
« Reply #9 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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: process terminated with status 12
« Reply #10 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.


C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline unasimulated

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: process terminated with status 12
« Reply #11 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?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: process terminated with status 12
« Reply #12 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".
  • build messages: are a shortened version of the Build log. This is the normal place where you find your compiler errors. Double click on one error and the editor will jump to the error line in your files
  • Build log: This is the output from codeblocks to the compiler (and linker) and back. Here a more advanced user finds all details about the build process. To help you we need all compiler flags, your include directories and so on and this all is written in the project file, but also, and more compact, with response from the compiler in the "build log". If you post in this forum we only (but mandatory) need the build log (and your problem description ;) )...

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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: process terminated with status 12
« Reply #13 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.

Offline unasimulated

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: process terminated with status 12
« Reply #14 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

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: process terminated with status 12
« Reply #15 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
« Last Edit: January 19, 2016, 11:35:15 am by BlueHazzard »

Offline unasimulated

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: process terminated with status 12
« Reply #16 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

Offline unasimulated

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: process terminated with status 12
« Reply #17 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

Offline unasimulated

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: process terminated with status 12
« Reply #18 on: January 20, 2016, 02:40:15 am »
thank you all for your help