[Qt-creator] printf() with Qt Creator?
Danny Price
deepblue842 at googlemail.com
Sat Apr 24 23:27:48 CEST 2010
OSX 10.6.3 Leopard, Qt 4.6.2, Creator build 1.3.83 (rev 026237b008).
pro:
SOURCES += main.cpp
CONFIG += console
Build log:
Running build steps for project ArrayTest...
Starting: /usr/bin/make clean -w
make: Entering directory `/Users/ks/Projects/ArrayTest-build'
rm -f main.o
rm -f *~ core *.core
make: Leaving directory `/Users/ks/Projects/ArrayTest-build'
Exited with code 0.
Configuration unchanged, skipping qmake step.
Starting: /usr/bin/make -w
make: Entering directory `/Users/ks/Projects/ArrayTest-build'
g++ -c -pipe -g -gdwarf-2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall -W -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.6.2/mkspecs/macx-g++ -I../ArrayTest -I/usr/local/Trolltech/Qt-4.6.2/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Trolltech/Qt-4.6.2/include/QtCore -I/usr/local/Trolltech/Qt-4.6.2/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Trolltech/Qt-4.6.2/include/QtGui -I/usr/local/Trolltech/Qt-4.6.2/include -I. -I../ArrayTest -I. -F/usr/local/Trolltech/Qt-4.6.2/lib -o main.o ../ArrayTest/main.cpp
g++ -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -o ArrayTest.app/Contents/MacOS/ArrayTest main.o -F/usr/local/Trolltech/Qt-4.6.2/lib -L/usr/local/Trolltech/Qt-4.6.2/lib -framework QtGui -L/usr/local/Trolltech/Qt-4.6.2/lib -F/usr/local/Trolltech/Qt-4.6.2/lib -framework QtCore
make: Leaving directory `/Users/ks/Projects/ArrayTest-build'
Exited with code 0.
(ArrayTest is just a dummy project I previously created for something else)
On 24 Apr 2010, at 22:21, Bruno Matos wrote:
> Strange, as was expected, works for me. Could you please attach the
> console output of your compiler. And give the information about your
> environment.
>
> Thank you.
>
> On 2010/04/24, at 21:25, Danny Price wrote:
>
>> Definitely an issue here. I created a C++ project and added CONFIG
>> += console to the pro file. The following does NOT print to the
>> console until after main returns (as shown with a breakpoint)
>>
>> #include <iostream>
>> int main()
>> {
>> std::cout << "test";
>> return 0;
>> }
>>
>>
>> However if I add cout.flush() before the return, the output appears:
>>
>> #include <iostream>
>> int main()
>> {
>> std::cout << "test";
>> std::cout.flush();
>> return 0;
>> }
>>
>> The CONFIG += console line appears to have NO EFFECT. This must be a
>> recent regression because I'm sure this used to work. I've not been
>> able to get it to work at all with <stdio.h> as I think it lacks a
>> standard function to flush the buffer.
>>
>>
>> On 15 Apr 2010, at 08:47, Brad Hubbard wrote:
>>
>>> Berk Demirkır wrote:
>>>> A simple program output that prints a lot via printf don't show on
>>>> Application Output. But when i close this application output
>>>> shows. Strange issue...
>>>>
>>> Sounds like the output buffer is not being flushed.
>>>
>>> Cheers,
>>> Brad
>>> _______________________________________________
>>> Qt-creator mailing list
>>> Qt-creator at trolltech.com
>>> http://lists.trolltech.com/mailman/listinfo/qt-creator
>>
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-creator
>
> --
> Bruno Matos
> bruno.matos at gmail.com
>
>
>
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20100424/42f7d6b6/attachment.html
More information about the Qt-creator-old
mailing list