Author Topic: The console does not open after starting the compiled program (ubuntu 10.4)  (Read 5890 times)

Offline stanislav

  • Single posting newcomer
  • *
  • Posts: 5
Hello, I'm new to Code::Blocks and have one problem, which stops me to begin to work on some small projects.

I use Ubuntu 10.4 (64 bit) and have the Code::Blocks SVN 6585 installed (from repositories).

I have made a simple C-Console Projekt with the help of cb. I've chosen the GCC Compiler.

The program was successfully compiled and I can start the manually from the folder where it is compiled in.

But trying to start the program with a console by pushing the button in cb do not work.

The xterm console does not open.

Because I'm using GNOME, I am interested in using the gnome terminal.

I have changed the command for opening a console to:
Code: [Select]
gnome-terminal -e $TITLE
or
Code: [Select]
gnome-terminal -x
.

With the last version the debugger works and the gnome-terminal opens. But ONLY with debugger, not by just starting the program.

Here is the message form the debugger:
Code: [Select]
Erstelle um zu gewährleisten das dieDateien auf Letzstand sind
Erstellen erfolgreich
Ziel wählen:
Release
Adding source dir: /home/stanislav/Desktop/Test1/
Adding source dir: /home/stanislav/Desktop/Test1/
Adding file: bin/Release/Test1
Starte Debugger:
erledigt
Neuen Typ registriert: wxString
Neuen Typ registriert: STL String
Neuen Typ registriert: STL Vector
Setze Haltpunkt
Reading symbols from /home/stanislav/Desktop/Test1/bin/Release/Test1...(no debugging symbols found)...done.
Debugger Nameund Version: GNU gdb (GDB) 7.1-ubuntu
Program exited normally.
Debugger wurde mit Status 0 beendet

Can some one help me please?

Thanks.
exp ( i * pi ) == -1

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The console does not open after starting the compiled program (ubuntu 10.4)
« Reply #1 on: September 13, 2010, 11:12:28 pm »
Works here with
Code: [Select]
gnome-terminal -t $TITLE -x
You must use -x, because for -e it needs quotes around the command (if spaces are included), and the -x has to be the last in the line.
-e executes the next parameter (that's why you need the quotes, what is not supported by C::B), -x executes the remaining command-line (so no quotes are needed).

Offline stanislav

  • Single posting newcomer
  • *
  • Posts: 5
Re: The console does not open after starting the compiled program (ubuntu 10.4)
« Reply #2 on: September 13, 2010, 11:32:07 pm »
Thanks for the quick post but it did not worked for me. Still nothing happens after press the "run" button.

Maybe it's a bug?
exp ( i * pi ) == -1

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The console does not open after starting the compiled program (ubuntu 10.4)
« Reply #3 on: September 13, 2010, 11:47:03 pm »
What happens if you use
Code: [Select]
gnome-terminal -t Test1 -x /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. /home/stanislav/Desktop/Test1/bin/Release/Test1 from a console ?
This should be the command executed if you just click the green triangle for run ( I hope I guessed it correctly) otherwise, copy it frm the build log and try it on the console.

Please post the output here, if you get anything more or less meaningful.

I also tested with C::B 6585 (from my repo) and there are no problems.

Offline stanislav

  • Single posting newcomer
  • *
  • Posts: 5
Re: The console does not open after starting the compiled program (ubuntu 10.4)
« Reply #4 on: September 13, 2010, 11:56:52 pm »
It's work normally. The program is started well.

So the command is correct, but it does not work in cb.

Hm... that's really annoying. Maybe I should look up some other preferences? But I don't know, what I can do...

PS: maybe it's compiz?
exp ( i * pi ) == -1

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The console does not open after starting the compiled program (ubuntu 10.4)
« Reply #5 on: September 14, 2010, 12:08:07 am »
Can you please copy and paste the whole Build log after trying to start your program with the run-button ?

Offline stanislav

  • Single posting newcomer
  • *
  • Posts: 5
Re: The console does not open after starting the compiled program (ubuntu 10.4)
« Reply #6 on: September 14, 2010, 01:53:19 am »
When pushing the run button (green arrow), nothing is shown in the build log.

When pushing the compile and run button (arrow and the gear), for less than a second this message appears:

Code: [Select]
-------------- Build: Release in Test1 ---------------

Target is up to date.


But it disappears immediately.

Here is the main.c file:

Code: [Select]
#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("Hello world!\n");
    //cin.get();
    getchar();
    return 0;
}

Seams to be a unknown problem here.
exp ( i * pi ) == -1

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The console does not open after starting the compiled program (ubuntu 10.4)
« Reply #7 on: September 14, 2010, 12:31:24 pm »
Can you zip and attach your project ?
*.cbp and sources are enough.

Offline stanislav

  • Single posting newcomer
  • *
  • Posts: 5
Re: The console does not open after starting the compiled program (ubuntu 10.4)
« Reply #8 on: September 14, 2010, 02:48:56 pm »
Here it is. Its just a project made by the cb wizard.

exp ( i * pi ) == -1