Results 1 to 3 of 3

Thread: No console output in Mac OSX using Qt4

  1. #1
    Join Date
    Sep 2006
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Windows

    Default No console output in Mac OSX using Qt4

    Hi!

    I'm working with a GLC Viewer application (GLC Viewer is based on Qt4, you can read more about it here: http://glc-lib.sourceforge.net/). When I try to do couts, nothing is showing in the terminal. I wrote a small test application which I compiled using qmake, but it didn't work. I modified the inital pro file with an extra line CONFIG += console and then recompiled, but it still didn't work. This is the code:

    test.cpp
    Qt Code:
    1. #include <iostream>
    2. #include <stdlib.h>
    3. #include <sstream>
    4.  
    5. int main(int, const char**) {
    6. std::cout << "Hi!" << std::endl;
    7. return 0;
    8. }
    To copy to clipboard, switch view to plain text mode 

    test.pro (edited, with the config line added)
    Qt Code:
    1. TEMPLATE =
    2. TARGET +=
    3. DEPENDPATH += .
    4. INCLUDEPATH += .
    5. CONFIG += console
    6.  
    7. # Input
    8. SOURCES += test.cpp
    To copy to clipboard, switch view to plain text mode 

    What's going on? Cout works on my computer in common C++ applications, so why doesn't it work in Qt applications?

    I'll be very grateful for any help.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: No console output in Mac OSX using Qt4


  3. The following user says thank you to jacek for this useful post:

    Zatraz (26th September 2006)

  4. #3
    Join Date
    Sep 2006
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Windows

    Default Re: No console output in Mac OSX using Qt4

    Thank you! =)
    Last edited by popoholic; 26th September 2006 at 01:48.

Similar Threads

  1. Unicode on (Win32) console
    By Greisby in forum Qt Programming
    Replies: 9
    Last Post: 13th February 2012, 13:17
  2. No output to console
    By Morea in forum Newbie
    Replies: 6
    Last Post: 1st November 2007, 22:51
  3. How to run a console program "silently"?
    By fullmetalcoder in forum Qt Programming
    Replies: 9
    Last Post: 23rd July 2006, 10:03
  4. QProcess output in TreeView?!?
    By nupul in forum Qt Programming
    Replies: 1
    Last Post: 2nd May 2006, 08:05
  5. Console apps in Kde Qt
    By peedarp in forum Qt Programming
    Replies: 5
    Last Post: 1st February 2006, 10:43

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.