Welcome! Log In Create A New Profile


Console output - Help please!

Posted by BenVP 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar Console output - Help please!
April 08, 2010 12:18PM
I know its a little late in the game, but I'm having trouble getting the output to the console. I know how to get output using a GUI application.

Take for example 6.5, I have created the empty Qt4 project, copied the Student.cpp, Student.h, and student-test.cpp files to the project directory. Then I added the .cpp files to the project in Qt4 and ignored the header file. Everything complied correctly.

But the question still remains, how do I see the program run in the Command Prompt? (Console output). The instructions given on page 141 seem to be for LINUX.

I even tried coping the code to C++ and compling there, to get output. Of course that didn't work since the program is written using Qt4 objects.

Any help, would be welcomed, sothat I can finish my assignment.
avatar Re: Console output - Help please!
April 08, 2010 01:29PM
You might have tried this already, but does the console window pop up and then disappear again? Try checking the "run in terminal" checkbox, Tutorial Letter 102 pg3, Creating projects.
avatar Re: Console output - Help please!
April 08, 2010 03:59PM
Great smile, at least a console application now appears. Yet it just shows "Press <RETURN> to close this window..."
Thanks travis512, I didn't see that part of the TL. I'm one step closer to finished.smoking smiley
avatar Re: Console output - Help please!
April 09, 2010 08:56PM
I've managed to get the SliderLCD example to compile and run from the files I copied.
I just have one question: the debug message appears on the application output tab in Qt4 and not in the Debug Log of sliderlcd.
How would I get the debug message to appear in sliderlcd?
Thanks Ben.
Anonymous User
Re: Console output - Help please!
April 17, 2010 01:07PM
I am also having the same problem; the command prompt appears but with the message "Press <RETURN> to close this window" How do i see the output?
avatar Re: Console output - Help please!
April 19, 2010 12:08PM
Figured it out. Every time you are asked to create a consol app, instead of creating a new empty Qt Project, create a Qt Consol app instead. Then all you need to do is remove the code generated by Qt inside the main and add your own. Don't forget to add your QTextStream cout(stdout, QIODevice::WriteOnly); above main, so you can call cout <<. Have funtongue sticking out smiley
Re: Console output - Help please!
August 03, 2010 08:44PM
I never recovered from the console problem (I did check "Run in terminal and included arguments"winking smiley of no output only "Press <RETURN> to close this window" PLEASE PLEASE HELP.
Sorry, only registered users may post in this forum.

Click here to login