News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

program compiles, builds but does not run

Started by Glassborow, November 27, 2012, 11:57:28 PM

Previous topic - Next topic

Glassborow

Whilst I am not new to Codeblocks (using it on Windows based machines) I am now trying to use it on a raspberry pi using the Denbian distro of Linux which is new territory for me.

I have (AFAICS) installed codeblocks and GCC 4.6 . I am now trying to develop a console app.

I am running codeblocks in an LXTerm 'window'. I have successfully created a console program (a simple hello world) and compiled and built it. Howver when I come to try to run it from within codeblocks I get an error@

Process terminated with status of 255.

The debug compile and built program runs correctly when invoked from outside codeblocks.

If it matters I am using SVN 8621.

Looking at the environment settings the following may be relevant:

Shell to run commands in  /bin/sh -c
Terminal to launch console programs:  xterm -T $TITLE -e

Can anyone help me over this hurdle

Thanks
Francis Glassborow

jarod42

I suspect your program doesn't have a return statement or return -1.

QuoteProcess terminated with status of 255.
show the return code of your application.

I suggest to check the 'pause when execution ends' in project properties.

In console:
./yourApp
echo $?

The second line will show the last return code.
(and it should be the same as reported by the IDE).


Glassborow

Thanks for your attempt find my problem. Unfortunately none of your suggestions move me forward  :(

Quote from: jarod42 on November 28, 2012, 11:19:45 AM
I suspect your program doesn't have a return statement or return -1.

No, it has a perfectly adequate return 0

QuoteProcess terminated with status of 255.
show the return code of your application.

I am pretty sure that that return code is bot from my program but from the process invoked to run my program.

I suggest to check the 'pause when execution ends' in project properties.

I had already checked, and it is. All my years of experience suggest that the problem occurs before my program starts. I get three messages in the build log window

Checking for existence: /home/pi/myprogs/test2/bin/Debug/test2
Executing: xterm -T test2 -e /usr/bin/cb_console_runner_LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. /home/pi/myprogs/test2/bin/Debug/test2 (in /home/pi/myprogs/test2/.)
Process terminated with status 255 (0 minutes 1 seconds)



In console:
./yourApp
echo $?

The second line will show the last return code.
(and it should be the same as reported by the IDE).

first line executes program, second line outputs nothing or was that supposed to be a batch file?

Thanks for trying
Francis



jarod42

Try preview before posting, your quoting is wrong.

What is the result of following command in console ?
xterm -T test2 -e /home/pi/myprogs/test2/bin/Debug/test2

Do you have xterm installed ?

If not, Search in the forum how to change 'terminal' that CB uses or install xterm.

Glassborow

OK it was the lack of xterm. I now have it sorted but still having problems with quoting  :)
I will get it sorted eventually

Thanks
Francis