Discussion:
uThisTask() and Forward Declaration Problem
(too old to reply)
Scott S
2003-12-01 04:33:54 UTC
Permalink
First off, can anyone tell me exactly what uThisTask() returns?
I thought it would be a pointer to the current task which I could use to
figure out which task is in the KBA, but when I tryed to compare it to my
User pointers the compiler didn't like it. I got this from the compiler:

"no match for 'User& == uBaseTask&' operator"


My other question has to do with forward declaration. I've put the
line:

uTask User;

in my KBA header file, but when I compile my .cc file I get the
message:

kba.cc:100: invalid use of undefined type 'struct User'
kba.h:10: forward declaration of 'struct User'

I get the invalid use message on the line where I create my Users and
where I delete them. The line in the header file is where I put the
'uTask User;'. Anyone know what I'm doing wrong?

thx
Scott
Ian MacDonald
2003-12-01 05:15:26 UTC
Permalink
uThisTask() returns a uBaseTask& (as seend in your error message)..
you may think of comparing the address it returns with things..

make sure you #include <uC++.h> before uTask User;

e.

On Sun, 30 Nov 2003, Scott S wrote:

First off, can anyone tell me exactly what uThisTask() returns?
I thought it would be a pointer to the current task which I could use to
figure out which task is in the KBA, but when I tryed to compare it to my
User pointers the compiler didn't like it. I got this from the compiler:

"no match for 'User& == uBaseTask&' operator"


My other question has to do with forward declaration. I've put the
line:

uTask User;

in my KBA header file, but when I compile my .cc file I get the
message:

kba.cc:100: invalid use of undefined type 'struct User'
kba.h:10: forward declaration of 'struct User'

I get the invalid use message on the line where I create my Users and
where I delete them. The line in the header file is where I put the
'uTask User;'. Anyone know what I'm doing wrong?

thx
Scott
Caroline Kierstead
2003-12-01 15:04:54 UTC
Permalink
Post by Scott S
First off, can anyone tell me exactly what uThisTask() returns?
I thought it would be a pointer to the current task which I could use to
figure out which task is in the KBA, but when I tryed to compare it to my
"no match for 'User& == uBaseTask&' operator"
Re-read the documentation in the uC++ reference manual. It returns
a uBaseTask object.
Post by Scott S
My other question has to do with forward declaration. I've put the
uTask User;
in my KBA header file, but when I compile my .cc file I get the
kba.cc:100: invalid use of undefined type 'struct User'
kba.h:10: forward declaration of 'struct User'
I get the invalid use message on the line where I create my Users and
where I delete them. The line in the header file is where I put the
'uTask User;'. Anyone know what I'm doing wrong?
You need to include the user header file in your KBA implementation file.
--
--
Caroline Kierstead, Instructional Support Coordinator
University of Waterloo, DC3138 (519) 888-4567 x6226
Loading...