|
-
December 29th, 2009, 03:10 PM
#3
Re: C2143, C2653; Weird class errors
I'm not sure I understand..How would this be circular dependency if both Item.h and Item.cpp don't use ItemDictionary ? I tried it out anyways, and forward declared the Item class in ItemDictionary.h; but the only problem now is,
ItemDictionary.h
-----------
...
struct ItemDictionary {
...
static List<Item*> items;
};
List.h
-----------
template<class T>
struct List
{
...
T data; // <-- C2079: 'List<T>: ata' uses undefined struct 'Item'
};
Even if I forward declare the Item struct on the top of List.h, it still comes up with the same error.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|