# Problem running programs in Qt Creator

Posted by TraceyB
Announcements Last Post
: Programming Students at UNISA School of Computing 06/19/2019 02:01PM
SoC Curricula 09/30/2017 01:08PM
Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
School of Computing Short Learning Programmes 11/24/2014 08:37AM
Unisa contact information 07/28/2011 01:28PM
 Problem running programs in Qt Creator July 30, 2011 08:42PM Registered: 11 years ago Posts: 342 Rating: 0
I created the test program that is given on the CD and it ran perfectly.

Now when I create new projects and copy code from the textbook I always get a 'exited with code 0' message and I don't see the output of the program.

Here is an example:

Starting C:\unisa\cos2614\ezust\Exerc1411-build-desktop\debug\Exerc1411.exe...
C:\unisa\cos2614\ezust\Exerc1411-build-desktop\debug\Exerc1411.exe exited with code 0

When I try to compile it from command prompt I don't get any errors but I also don't see a screen.
I copied and pasted the code straight from the textbook and I made the necessary changes given in Tut 102 to the project so it will compile in the command prompt.

 Re: Problem running programs in Qt Creator July 30, 2011 09:50PM Registered: 14 years ago Posts: 1,424 Rating: 0
It's not an error. It means that the program started, it did it's thing and then it finished. Nothing sinister at all.

If you're looking for output to a console, make sure that you've set the project to compile as a console, since they compile as GUI programs by default.

Check your project file and make sure that the qmake variable CONFIG has console added to it

eg

CONFIG += console
 Re: Problem running programs in Qt Creator July 31, 2011 12:10PM Registered: 11 years ago Posts: 342 Rating: 0
Thanks, I'm getting there. I'd forgotten to check Run in terminal.
But now when I run it from Qt Creator, I get a dos window opening but all it says is "Press <RETURN> to close this window" and when I run it from command prompt, it waits a couple of seconds and then I get the prompt again.
I'm trying to run exercise 1.4.1.1 where I should be prompted to supply input.
 Re: Problem running programs in Qt Creator August 24, 2011 08:19PM Registered: 9 years ago Posts: 8 Rating: 0
Tracy, I've got the same problem. Still trying to fix it.

Does anybody know what could be causing it?
Sorry, only registered users may post in this forum.