M
mark
I have this class:
class Selections {
OSStatus Init();
protected:
CFMutableSetRef selectionObjects;
static void CFASelectionsApplier(const void* value, void* ctx);
OSType ready;
public:
Selections();
Selections(const Selections &obj);
virtual ~Selections();
virtual OSType GetSelectionScope();
virtual UInt32 GetSelectCount(SelectionFlag whichFlags);
virtual CFArrayRef GetSelObjects(SelectionFlag whichFlags);
UInt32 GetCountOfClass(SelObjectClass theClass);
CFArrayRef GetSelObjectsOfClass(SelObjectClass theClass);
virtual UInt32 GetCountOfScope(OSType theScope);
virtual CFArrayRef GetArrayofScope(OSType theScope);
virtual OSStatus MassAddSelObjects(CFArrayRef sorArray);
virtual OSStatus AddSelectededObject(SelectedObjectRef soref);
virtual OSStatus MassRemoveSelObjects(CFArrayRef sorArray);
virtual OSStatus RemoveSelectedObject(SelectedObjectRef soref);
virtual void RemoveAllSelectedObjects(SelectionFlag whichFlags);
void RemoveSelObjectsOfClass(SelObjectClass theClass);
virtual void RemoveSelObjectsOfScope(OSType theScope);
virtual void RemoveAll();
};
and a subclass:
typedef class DirView DirView;
class DVSelections: public Selections {
DirView* view;
OSType dvsReady;
public:
DVSelections(DirView* theView);
DVSelections(const DVSelections &obj);
~DVSelections();
OSType GetSelectionScope();
DirView* GetView();
};
When I attempt to compile it, the linker complains with this message:
/usr/bin/ld: Undefined symbols:
vtable for DVSelections
I was under the impression if the virtual function is not defined in a
subclass, the parent class's function will be used.
What am I missing?
This is mac OS X, XCode 2.2 with gcc 4.
TIA
Mark
class Selections {
OSStatus Init();
protected:
CFMutableSetRef selectionObjects;
static void CFASelectionsApplier(const void* value, void* ctx);
OSType ready;
public:
Selections();
Selections(const Selections &obj);
virtual ~Selections();
virtual OSType GetSelectionScope();
virtual UInt32 GetSelectCount(SelectionFlag whichFlags);
virtual CFArrayRef GetSelObjects(SelectionFlag whichFlags);
UInt32 GetCountOfClass(SelObjectClass theClass);
CFArrayRef GetSelObjectsOfClass(SelObjectClass theClass);
virtual UInt32 GetCountOfScope(OSType theScope);
virtual CFArrayRef GetArrayofScope(OSType theScope);
virtual OSStatus MassAddSelObjects(CFArrayRef sorArray);
virtual OSStatus AddSelectededObject(SelectedObjectRef soref);
virtual OSStatus MassRemoveSelObjects(CFArrayRef sorArray);
virtual OSStatus RemoveSelectedObject(SelectedObjectRef soref);
virtual void RemoveAllSelectedObjects(SelectionFlag whichFlags);
void RemoveSelObjectsOfClass(SelObjectClass theClass);
virtual void RemoveSelObjectsOfScope(OSType theScope);
virtual void RemoveAll();
};
and a subclass:
typedef class DirView DirView;
class DVSelections: public Selections {
DirView* view;
OSType dvsReady;
public:
DVSelections(DirView* theView);
DVSelections(const DVSelections &obj);
~DVSelections();
OSType GetSelectionScope();
DirView* GetView();
};
When I attempt to compile it, the linker complains with this message:
/usr/bin/ld: Undefined symbols:
vtable for DVSelections
I was under the impression if the virtual function is not defined in a
subclass, the parent class's function will be used.
What am I missing?
This is mac OS X, XCode 2.2 with gcc 4.
TIA
Mark