Namespace linkage problem
by Leo Willman · in RTS Starter Kit · 11/18/2005 (7:01 am) · 2 replies
We are using the RTS-kit to make a RTS game and have declared our own unit class that inherits from RTSUnit. We also have a class UnitData that inherits from RTSUnitData like this:
On startup we get the following error at the top of the console:
I can't figure out why this error occures. Any ideas? Thanks!
// Unit.h
class UnitData: public RTSUnitData
{
private:
typedef RTSUnitData Parent;
public:
//...
DECLARE_CONOBJECT( UnitData );
};
// Unit.cc
IMPLEMENT_CO_DATABLOCK_V1( UnitData );On startup we get the following error at the top of the console:
Error: cannot change namespace parent linkage for UnitData from SimObject to RTSUnitData.
I can't figure out why this error occures. Any ideas? Thanks!
About the author
Recent Threads
#2
I did check for another object named UnitData before posting but now when I did follow your advice to change the name of it I found the second definition in the first file I checked. Thanks Tom!
11/21/2005 (5:56 am)
Well, now I feel really stupid :PI did check for another object named UnitData before posting but now when I did follow your advice to change the name of it I found the second definition in the first file I checked. Thanks Tom!
Torque Owner Tom Richardson
Change the name to ModUnitData or something else, or just do a happy slappy find in files.
Seems to have issues with casting back from RTSUnitData lineage.