Results 1 to 3 of 3

Thread: config += console for mac

  1. #1
    Join Date
    Jan 2006
    Posts
    73
    Thanks
    16
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default config += console for mac

    Hello,
    On windows my .pro file contains the line
    CONFIG += console
    which is convenient to display some info on the console using std::cout <<
    I have ported some codes to the Mac (OSX) and I was naively expecting to see the data on the terminal window... Well the terminal window remains blank and the data are lost in the universe... Any idea on how to port that section of the code?
    Thanks

  2. #2
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: config += console for mac

    You need the "console" option under Windows because that's the only way to get standard C++ I/O. But you don't need that under Unix or the Mac. Just run it from a terminal window and you'll automatically get normal stdin/stdout behavior.

    Because Macs use application bundles, you need to use the "open" command to launch them from the terminal:

    open myapp.app

  3. #3
    Join Date
    Jan 2006
    Location
    New Malden (near London)
    Posts
    32
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: config += console for mac

    Quote Originally Posted by Brandybuck
    You need the "console" option under Windows because that's the only way to get standard C++ I/O. But you don't need that under Unix or the Mac. Just run it from a terminal window and you'll automatically get normal stdin/stdout behavior.

    Because Macs use application bundles, you need to use the "open" command to launch them from the terminal:

    open myapp.app
    You need to suppress bundle production on the Mac, by adding this line to your .pro file:

    CONFIG-=app_bundle

    It is in the deployment documentation; see here.

  4. The following user says thank you to Matt Smith for this useful post:

    sunil.thaha (26th September 2006)

Similar Threads

  1. How to run a console program "silently"?
    By fullmetalcoder in forum Qt Programming
    Replies: 9
    Last Post: 23rd July 2006, 10:03
  2. QPainter in console apps?
    By Funklord in forum Qt Programming
    Replies: 2
    Last Post: 18th April 2006, 14:03
  3. Console apps in Kde Qt
    By peedarp in forum Qt Programming
    Replies: 5
    Last Post: 1st February 2006, 10:43
  4. qt without console window
    By jh in forum Qt Programming
    Replies: 3
    Last Post: 28th January 2006, 20:01

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.