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
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
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.