Welcome! Log In Create A New Profile


Example 1.12 from Online book

Posted by tshax 
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
Example 1.12 from Online book
January 20, 2010 12:39PM
Hi All,

I get the following errors `QIOdevice' has not been declared and `WriteOnly' was not declared in this scope, when running the example. Can anyone tell how to solve this error.

sad smiley
Re: Example 1.12 from Online book
January 20, 2010 09:09PM
Hi tshax

I hope that you can help. You seem to be using the software and making good progress. I have a question. I have installed the software and ran the Hello example. It worked fine. I have tried to run the next examples in the book (like 1.4 What is your name....). My question is when I build I get no errors and running also seems to be fine. As I understand if the program executes fine it would state something like exiting 0 which means no problems right. exiting on 1 is a problem.

After I press the execute / run button where does the program actully execute? I do not see the "where is you name" question anywhere? I saw it once to be honest but then when I enter a name and hit enter nothing happens...no next question? What am I doing wrong? Am I expecting something that should not be there or am I missing files ar what? Where should the code execute. I expected it in the Application output Tab...

I am a bit fustrated as I feel it must be something obvious I am not doing. Please Help?

Re: Example 1.12 from Online book
January 21, 2010 03:14PM
Hi Natacha,

Did you select Qt4 console Application when creating your program? smile
Re: Example 1.12 from Online book
January 25, 2010 09:30PM

Thanks. Initially I did as you said - at least the cmd box did pop up but nothing. After stuggeling for a long while I decided to download the software again. I found that on th website a newer version was available. Just installed and all worked.

Much apprechiated.
Re: Example 1.12 from Online book
February 08, 2010 10:21PM
Hi there

When trying to run Example 3.6 as described in Tut102 I get the following error

c:/qt/2010.01/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingw32.a(main.o):main.c::-1: error: undefined reference to `WinMain@16'

Does anybody have any idea what this means and what to do how to fix it? Please help.

Re: Example 1.12 from Online book
March 30, 2010 07:16PM
undefined reference to `WinMain@16' Means you don't have a main function. If you do then it means your c runtime is not being linked in.

You are most likely using mingw if you are getting that error. Just do a google search using the error message and the ming.

Re: Example 1.12 from Online book
March 31, 2010 08:22AM
Hello everyone

May anyone of u having the PDF version of the book for COS2144 email to me. Im just using the one from their website and struggling. My email is lekokoanep@hotmail.com
avatar Re: Example 1.12 from Online book
March 31, 2010 09:49PM

undefined reference to `WinMain@16'

This is a linker error and it sounds like you're not linking in one of the Qt library files. WinMain is the entry point for all windows programs like main is for console programs. It should be hidden inside the QtCore library and linked in when you compile.

You are most likely using mingw if you are getting that error

If you're using QCreator on Windows you're going to be using the MinGW compiler, it's the only one that ships with the Windows version of the IDE.
Sorry, only registered users may post in this forum.

Click here to login