Author Topic: Console window on Linux/C++  (Read 3764 times)

0 Members and 1 Guest are viewing this topic.

Offline nawitus

  • C= 64
  • **
  • Posts: 50
  • Karma: 1
    • View Profile
Console window on Linux/C++
« on: February 02, 2009 »
Hi', I'm coding an OpenGL library using C++ in Ubuntu 8.10 and using the Geany IDE 0.14. If I run the program for terminal for example, cout is not printing anything to there.. I really need a console window to debug some stuff like FPS information while I'm running the program.

My compile argument is: (not sure if this is relevant..)
g++ -Wall -c "%f" -lSDL `sdl-config –cflags –libs` -lSDL_ttf -lSDL_gfx -lSDL_mixer -lGL -lGLU -lGLEW


Offline JL235

  • C= 64
  • **
  • Posts: 71
  • Karma: 9
    • View Profile
    • Play My Code
Re: Console window on Linux/C++
« Reply #1 on: February 02, 2009 »
A bunch of random ideas:

Quote
If I run the program for terminal for example
When you say 'for terminal' do you mean your running it from a terminal or from Geany IDE with some terminal mode? If your running it from the IDE try going to the program manually in a terminal and run it from there. It might be that the IDE is redirecting the output to somewhere.

If you compile a 'hello world' program, does this print correctly to the terminal?

Are you doing any redirection of the standard output in the program (i.e. it could be a bug that you've added)?
Play My Code - build games in your browser!

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Console window on Linux/C++
« Reply #2 on: February 02, 2009 »
More random ideas.  Can you check the value of stdout?  Is your program finishing before the output is flushed to the console?

Jim
Challenge Trophies Won:

Offline nawitus

  • C= 64
  • **
  • Posts: 50
  • Karma: 1
    • View Profile
Re: Console window on Linux/C++
« Reply #3 on: February 02, 2009 »
It's fixed now. Turns out an update to Geany breaks building projects, described here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=479795