Author Topic: Problem with running application in Ubuntu  (Read 3548 times)

Offline AlekseyT

  • Multiple posting newcomer
  • *
  • Posts: 13
Problem with running application in Ubuntu
« on: July 27, 2007, 10:20:18 am »
I have problem on Ubuntu system. Then I compile and run console project terminal window start but show nothing. I get string what use Code::Blocks when start application:
Code: [Select]
Executing: xterm -T TTTT -e /bin/sh -c /usr/bin/cb_console_runner /home/MyProject/TTTT/bin/Debug/TTTT  (in /home/MyProject/TTTT/.)

Then I run command
Code: [Select]
# sh -c /usr/bin/cb_console_runner /home/MyProject/TTTT/bin/Debug/TTTT
in console I see message
Code: [Select]
Usage: cb_console_runner <filename> <args ...>
As you see shell (/bin/sh) run program cb_console_runner but do not give its arguments. I no find settings what can delete word "sh -c" from command line (i find only non-working Settings->Environment->General Settings->Shell to run command in ...). Please help me :(

Thank you

[CB build 4324]

Offline Vorl

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Problem with running application in Ubuntu
« Reply #1 on: August 02, 2007, 06:22:34 pm »
Hello,

I had the same problem.

I suspect that the best would be to enclose commands and args by doublequotes after the sh -c (eg. to have /bin/sh -c "/usr/bin/cb_console_runner /home/MyProject/TTTT/bin/Debug/TTTT"), but it's something that require modification of CB itself. So for the moment, I have done the following :
I have unchecked "pause when execution ends" in the properties of the project and this cause cb_console_runner not to be used. Then I replaced xterm by "konsole --noclose" to force a pause after execution (gnome console should have something equivalent (?)).
Now it works except that this time it is the arguments of my program that are not used (due to the same problem with sh -c). But as long as you do not have arg for your program, it should work.
 

Offline rhf

  • Multiple posting newcomer
  • *
  • Posts: 123
Re: Problem with running application in Ubuntu
« Reply #2 on: August 02, 2007, 07:21:22 pm »
I have unchecked "pause when execution ends" in the properties of the project and this cause cb_console_runner not to be used. Then I replaced xterm by "konsole --noclose" to force a pause after execution (gnome console should have something equivalent (?)).
Vorl,
Hmm. My question is Windows not Ubuntu related, but you have peaked my curiosity. I frequently create console outputs using "pause when execution ends" and find it very awkward to have to close the console window before CB receives the focus.  Also, I often want to keep multiple console windows open so that I can quickly compare the results of code/variable changes, etc. Do you know if there is an equivalent procedure that you describe here for use in Windows.
Thanks,

Offline Vorl

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Problem with running application in Ubuntu
« Reply #3 on: August 02, 2007, 10:47:06 pm »
I'm sorry but I dont know CB from inside. Under windows the two settings lines for the shell and the console commands are grayed so I guess that CB use a hard coded call to launch the console under windows but this has to be confirm by a dev.
I suppose you use "> file" as final arg of your prog to dump the results in different files to compare ? Clearly less confortable but I dont see another solution for your problem.