Game Development Community

RTSSquad Coding Help

by Altedor · in Torque Game Engine · 03/29/2006 (5:36 am) · 3 replies

Hey,
I'm currently coding some new classes for the engine to help me with our RTS project, but the Visual Studio compiler is spewing out errors where there are none ; note: the engine compiles fine without these files.
Here are the errors the compiler returns when compiling RTSSquad.cc and RTSSquad.h.
RTSSquad.cc
1>..\engine\game\RTS\RTSSquad.cc(17) : error C2143: syntax error : missing ';' before '*'
1>..\engine\game\RTS\RTSSquad.cc(17) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\engine\game\RTS\RTSSquad.cc(17) : error C2556: 'int *RTSSquad::getClassRep(void) const' : overloaded function differs only by return type from 'AbstractClassRep *RTSSquad::getClassRep(void) const'
1>        c:\Torque\RTSStarterKit\engine\game/RTS/RTSSquad.h(73) : see declaration of 'RTSSquad::getClassRep'
1>..\engine\game\RTS\RTSSquad.cc(17) : error C2371: 'RTSSquad::getClassRep' : redefinition; different basic types
1>        c:\Torque\RTSStarterKit\engine\game/RTS/RTSSquad.h(73) : see declaration of 'RTSSquad::getClassRep'
1>..\engine\game\RTS\RTSSquad.cc(17) : error C2143: syntax error : missing ';' before '*'
1>..\engine\game\RTS\RTSSquad.cc(17) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\engine\game\RTS\RTSSquad.cc(17) : error C2371: 'AbstractClassRep' : redefinition; different basic types
1>        ..\engine\game\RTS\RTSSquad.cc(17) : see declaration of 'AbstractClassRep'
1>..\engine\game\RTS\RTSSquad.cc(17) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\engine\game\RTS\RTSSquad.cc(17) : error C2556: 'int *RTSSquad::getStaticClassRep(void)' : overloaded function differs only by return type from 'AbstractClassRep *RTSSquad::getStaticClassRep(void)'
1>        c:\Torque\RTSStarterKit\engine\game/RTS/RTSSquad.h(73) : see declaration of 'RTSSquad::getStaticClassRep'
1>..\engine\game\RTS\RTSSquad.cc(17) : error C2371: 'RTSSquad::getStaticClassRep' : redefinition; different basic types
1>        c:\Torque\RTSStarterKit\engine\game/RTS/RTSSquad.h(73) : see declaration of 'RTSSquad::getStaticClassRep'
1>..\engine\game\RTS\RTSSquad.cc(17) : error C2143: syntax error : missing ';' before '*'
1>..\engine\game\RTS\RTSSquad.cc(17) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\engine\game\RTS\RTSSquad.cc(17) : error C2371: 'AbstractClassRep' : redefinition; different basic types
1>        ..\engine\game\RTS\RTSSquad.cc(17) : see declaration of 'AbstractClassRep'
1>..\engine\game\RTS\RTSSquad.cc(17) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\engine\game\RTS\RTSSquad.cc(17) : error C2556: 'int *RTSSquad::getParentStaticClassRep(void)' : overloaded function differs only by return type from 'AbstractClassRep *RTSSquad::getParentStaticClassRep(void)'
1>        c:\Torque\RTSStarterKit\engine\game/RTS/RTSSquad.h(73) : see declaration of 'RTSSquad::getParentStaticClassRep'
1>..\engine\game\RTS\RTSSquad.cc(17) : error C2371: 'RTSSquad::getParentStaticClassRep' : redefinition; different basic types
1>        c:\Torque\RTSStarterKit\engine\game/RTS/RTSSquad.h(73) : see declaration of 'RTSSquad::getParentStaticClassRep'
1>..\engine\game\RTS\RTSSquad.cc(18) : error C2143: syntax error : missing ';' before '*'
1>..\engine\game\RTS\RTSSquad.cc(18) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\engine\game\RTS\RTSSquad.cc(18) : error C2371: 'AbstractClassRep' : redefinition; different basic types
1>        ..\engine\game\RTS\RTSSquad.cc(17) : see declaration of 'AbstractClassRep'
1>..\engine\game\RTS\RTSSquad.cc(18) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\engine\game\RTS\RTSSquad.cc(18) : error C2556: 'int *RTSSquadData::getClassRep(void) const' : overloaded function differs only by return type from 'AbstractClassRep *RTSSquadData::getClassRep(void) const'
1>        c:\Torque\RTSStarterKit\engine\game/RTS/RTSSquad.h(26) : see declaration of 'RTSSquadData::getClassRep'
1>..\engine\game\RTS\RTSSquad.cc(18) : error C2371: 'RTSSquadData::getClassRep' : redefinition; different basic types
1>        c:\Torque\RTSStarterKit\engine\game/RTS/RTSSquad.h(26) : see declaration of 'RTSSquadData::getClassRep'
1>..\engine\game\RTS\RTSSquad.cc(18) : error C2143: syntax error : missing ';' before '*'
1>..\engine\game\RTS\RTSSquad.cc(18) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\engine\game\RTS\RTSSquad.cc(18) : error C2371: 'AbstractClassRep' : redefinition; different basic types
1>        ..\engine\game\RTS\RTSSquad.cc(17) : see declaration of 'AbstractClassRep'
1>..\engine\game\RTS\RTSSquad.cc(18) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\engine\game\RTS\RTSSquad.cc(18) : error C2556: 'int *RTSSquadData::getStaticClassRep(void)' : overloaded function differs only by return type from 'AbstractClassRep *RTSSquadData::getStaticClassRep(void)'
1>        c:\Torque\RTSStarterKit\engine\game/RTS/RTSSquad.h(26) : see declaration of 'RTSSquadData::getStaticClassRep'
1>..\engine\game\RTS\RTSSquad.cc(18) : error C2371: 'RTSSquadData::getStaticClassRep' : redefinition; different basic types
1>        c:\Torque\RTSStarterKit\engine\game/RTS/RTSSquad.h(26) : see declaration of 'RTSSquadData::getStaticClassRep'
1>..\engine\game\RTS\RTSSquad.cc(18) : error C2143: syntax error : missing ';' before '*'
1>..\engine\game\RTS\RTSSquad.cc(18) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\engine\game\RTS\RTSSquad.cc(18) : error C2371: 'AbstractClassRep' : redefinition; different basic types
1>        ..\engine\game\RTS\RTSSquad.cc(17) : see declaration of 'AbstractClassRep'
1>..\engine\game\RTS\RTSSquad.cc(18) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\engine\game\RTS\RTSSquad.cc(18) : error C2556: 'int *RTSSquadData::getParentStaticClassRep(void)' : overloaded function differs only by return type from 'AbstractClassRep *RTSSquadData::getParentStaticClassRep(void)'
1>        c:\Torque\RTSStarterKit\engine\game/RTS/RTSSquad.h(26) : see declaration of 'RTSSquadData::getParentStaticClassRep'
1>..\engine\game\RTS\RTSSquad.cc(18) : error C2371: 'RTSSquadData::getParentStaticClassRep' : redefinition; different basic types
1>        c:\Torque\RTSStarterKit\engine\game/RTS/RTSSquad.h(26) : see declaration of 'RTSSquadData::getParentStaticClassRep'
Here are the lines of codes the errors spring on:
//From RTSWeapon.c++ (Lines 17+18)
IMPLEMENT_CO_NETOBJECT_V1( RTSSquad );
IMPLEMENT_CO_DATABLOCK_V1( RTSSquadData );
//From RTSWeapon.h (Line 26)
DECLARE_CONOBJECT(RTSSquadData);
I cannot seem to resolve the issue, can anyone help?
If you require to see more of the code just ask.
Thanks
Jack

#1
03/30/2006 (11:46 pm)
Whats on lines 14-16?
#2
03/31/2006 (4:12 am)
I resolved this problem
Http://www.garagegames.com/mg/forums/result.thread.php?qt=42120
#3
03/31/2006 (1:35 pm)
Is this all your own code, or part of the RTS-SK? If part of the RTS-SK (modified obviously!) your best bet would be to ask in that forum.