Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: silverzhao on November 30, 2010, 11:19:09 am

Title: Process terminated with status 255
Post by: silverzhao on November 30, 2010, 11:19:09 am
Hello, I have a problems here: whenever I run a program, even just a simple "HelloWorld", it will say "Process terminated with status 255" as the red line shows.I wonder why it is not 0 . Thank you!
Well, I'm using codeblocks svn 6840 on ubuntu 10.10, and in "settings --> Environmet", I use "gnome-terminal -t $TITLE -x".
Title: Re: Process terminated with status 255
Post by: thomas on November 30, 2010, 11:32:43 am
http://forums.codeblocks.org/index.php/topic,13743.msg92605.html#msg92605
Title: Re: Process terminated with status 255
Post by: silverzhao on December 01, 2010, 06:30:42 am
http://forums.codeblocks.org/index.php/topic,13743.msg92605.html#msg92605
Thank you for your kind reply, but I still do not quite understand it. I have xterm installed, but I prefer gnome-terminal. So is there any way that I can change return value 255 to 0? Thank you!
Title: Re: Process terminated with status 255
Post by: Jenna on December 01, 2010, 08:07:40 am
Does it work from a console ?

I use gnome-terminal on my system and have no such issues.
Title: Re: Process terminated with status 255
Post by: silverzhao on December 10, 2010, 07:59:49 am
Does it work from a console ?

I use gnome-terminal on my system and have no such issues.

I've just tried it. If I start CodeBlocks in gnome-terminal,  it works well, no more the annoying red line! But if I open it from "Applications" --> "Programming" --> "Code::Blocks IDE", the annoying red line comes back again! So why is this? Thank you!
Title: Re: Process terminated with status 255
Post by: silverzhao on December 17, 2010, 03:03:16 pm
I've found something interesting: if I open the gnome-terminal before executing the program in codeblocks, it will not show the red line any more. But once I close the gnome-terminal and execute the program again, the annoying red line comes back at once! Is there anything different here?
Title: Re: Process terminated with status 255
Post by: wangdong1226 on February 11, 2011, 09:05:35 am
Here is a 'solution':

=========
Here's the command I use:

Code:
--------
gnome-terminal --disable-factory -t $TITLE -x
--------

The "--disable-factory" argument runs gnome-terminal in it's own process, apart from other gnome-terminal processes you have running. Without it gnome-terminal will return 255 upon exit, unless you have another gnome-terminal already open.

This is still only a partial solution, since gnome-terminal will return 0 to Code::Blocks, regardless of what your program returns... If anyone has a solution to this problem, please let us know.
=========

This solution quoted from: http://www1.ubuntuforums.org/showthread.php?p=10251821

And you can make a little bit change:

--------
gnome-terminal --disable-factory --hide-menubar -t $TITLE -x
--------

or

--------
gnome-terminal --disable-factory --hide-menubar  -t $TITLE -e
--------
(maybe can not works)
Title: Re: Process terminated with status 255
Post by: Jenna on February 11, 2011, 09:37:12 am
Here is a 'solution':

=========
Here's the command I use:

Code:
--------
gnome-terminal --disable-factory -t $TITLE -x
--------

The "--disable-factory" argument runs gnome-terminal in it's own process, apart from other gnome-terminal processes you have running. Without it gnome-terminal will return 255 upon exit, unless you have another gnome-terminal already open.

This is still only a partial solution, since gnome-terminal will return 0 to Code::Blocks, regardless of what your program returns... If anyone has a solution to this problem, please let us know.
=========

This solution quoted from: http://www1.ubuntuforums.org/showthread.php?p=10251821

And you can make a little bit change:

--------
gnome-terminal --disable-factory --hide-menubar -t $TITLE -x
--------

or

--------
gnome-terminal --disable-factory --hide-menubar  -t $TITLE -e
--------
(maybe can not works)

For me it works without --disable-factory, but this might be due to my gnome settings.

Code
gnome-terminal --disable-factory --hide-menubar  -t $TITLE -e

does not work, because it needs quotation around the command after the -e, otherwise only the first parameter is used as command and that can not work (in almost any cases), -x uses the remaining parameters as command.
Title: Re: Process terminated with status 255
Post by: wangdong1226 on February 11, 2011, 12:39:00 pm
or if want to resize the size of the window, can do like this:

gnome-terminal --disable-factory --hide-menubar --geometry 70x24+50+0 -t $TITLE -x

70x24: size of the window;
+50+0: window position in screen.

Dear Jens,
does "This is still only a partial solution, since gnome-terminal will return 0 to Code::Blocks, regardless of what your program returns..." will happen in your system?
Title: Re: Process terminated with status 255
Post by: Jenna on February 11, 2011, 12:45:55 pm
Dear Jens,
does "This is still only a partial solution, since gnome-terminal will return 0 to Code::Blocks, regardless of what your program returns..." will happen in your system?

Unfortunately yes !