I would run the preprocess command in the project menu in CW for the
file which fails to compile.  You may find that your classes aren't
included in the order that you think they are.

Bill MacAdam
Visual Solutions


-----Original Message-----
From: Richard Coutts [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 7:38 AM
To: Palm Developer Forum
Subject: undefined identifier error


I'm getting a compiler error that has me a bit dumbfounded.  I have a
header
file for a subclass and CodeWarrior is balking at the class definition.

My base class is "ccList" and the subclass is "ccNodeList."  CodeWarrior
is
flagging the word "ccList" in the line "class ccNodeList : public ccList
{"
with the error "undefined identifier 'ccList'" (the code's listed
below).

At first I assumed I was using the same #define at the top of my header
file, causing "List.h" (which contains 'ccList') not to be included, but
the
#define's are okay.  I got this error earlier and put 'ccList' in its
own
header file by itself and things worked fine for a while, but now the
error's back.

My app is growing and I have a dozen or so #includes in each .cpp files
(but
not too many in my .h files).  I'm wondering if there's some internal CW
limits be aware of, not that I could imagine what it would be, or if
something else is going on.

Below are the two header files (the first is "List.h" and the second is
"NodeList.h").  Any insight will be greatly appreciated.

Thanks!
Rich

#ifndef _LIST_H_
#define _LIST_H_

class ccHolder {
public: // constructors
    ccHolder();
public: // members
    void* data;
    ccHolder* next;
};

class ccList {
public: // constructors
    ccList();
    ~ccList() {}
public: // methods to cast by subclass
    void __pushTail(void* data);
    void __pushHead(void* data);
    void* __head();
    void* __popHead();
    void* __popTail();
    void* __tail();
    void* __nextData();
    void* __data(UInt16 index);
public: // methods that don't need to be cast
    UInt16 length();
    Boolean isEmpty() {return _headHolder == NULL;}
private: // methods
    ccHolder* _tailHolder();
private: // members
    ccHolder* _headHolder;
    ccHolder* _currHolder;
};

#endif




#ifndef _NODELIST_H_
#define _NODELIST_H_

#include "List.h"

class ccDrawingNode;

class ccNodeList : public ccList { <<<<<<<<<< CodeWarrior IS BALKING
HERE ON
'ccLIST'
public: // constructors
    ccNodeList() : ccList() {}
    ~ccNodeList(); // delete all the holders, but not their contents
public: // methods
    void setTo(ccNodeList&); // copy another list
    void dumpNodes(); // empty the list
public: // cast methods
    void pushTail(ccDrawingNode* node) {__pushTail((void*)node);}
    void pushHead(ccDrawingNode* node) {__pushHead((void*)node);}
    ccDrawingNode* head() {return (ccDrawingNode*)__head();}
    ccDrawingNode* popHead() {return (ccDrawingNode*)__popHead();}
    ccDrawingNode* popTail() {return (ccDrawingNode*)__popTail();}
    ccDrawingNode* tail() {return (ccDrawingNode*)__tail();}
    ccDrawingNode* nextNode() {return (ccDrawingNode*)__nextData();}
         // (init internal pointer by calling 'head()')
    ccDrawingNode* nodePtr(UInt16 i) {return (ccDrawingNode*)__data(i);}
};

#endif



-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/


--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to