View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0004937 | Spring engine | General | public | 2015-08-26 15:42 | 2017-05-03 00:43 | ||||
Reporter | abma | ||||||||
Assigned To | |||||||||
Priority | normal | Severity | major | Reproducibility | have not tried | ||||
Status | closed | Resolution | fixed | ||||||
Product Version | 100.0+git | ||||||||
Target Version | Fixed in Version | 103.0 +git | |||||||
Summary | 0004937: compile error: 'AAirMoveType': cannot instantiate abstract class | ||||||||
Description | C:\Users\Alex\Desktop\spring\rts\Sim\MoveTypes\AAirMoveType.cpp(15): error C2259: 'AAirMoveType': cannot instantiate abstract class C:\Users\Alex\Desktop\spring\rts\Sim\MoveTypes\AAirMoveType.cpp(15): note: due to following members: C:\Users\Alex\Desktop\spring\rts\Sim\MoveTypes\AAirMoveType.cpp(15): note: 'void AMoveType::StartMoving(float3,float,float)': is abstract c:\users\alex\desktop\spring\rts\sim\movetypes\MoveType.h(23): note: see declaration of 'AMoveType::StartMoving' C:\Users\Alex\Desktop\spring\rts\Sim\MoveTypes\AAirMoveType.cpp(15): note: 'void AMoveType::StartMoving(float3,float)': is abstract c:\users\alex\desktop\spring\rts\sim\movetypes\MoveType.h(22): note: see declaration of 'AMoveType::StartMoving' C:\Users\Alex\Desktop\spring\rts\Sim\MoveTypes\AAirMoveType.cpp(15): note: 'void AMoveType::KeepPointingTo(float3,float,bool)': is abstract c:\users\alex\desktop\spring\rts\sim\movetypes\MoveType.h(24): note: see declaration of 'AMoveType::KeepPointingTo' C:\Users\Alex\Desktop\spring\rts\Sim\MoveTypes\AAirMoveType.cpp(15): note: 'void AMoveType::StopMoving(bool,bool)': is abstract c:\users\alex\desktop\spring\rts\sim\movetypes\MoveType.h(26): note: see declaration of 'AMoveType::StopMoving' clang-cl.exe: error: clang frontend command failed with exit code 2 (use -v to see invocation) | ||||||||
Tags | No tags attached. | ||||||||
Checked infolog.txt for Errors | |||||||||
Attached Files |
|
![]() |
|
abma (administrator) 2015-08-26 15:42 |
backlink: https://springrts.com/phpbb/viewtopic.php?p=572742#p572742 |
Kloot (developer) 2015-08-26 17:27 Last edited: 2015-08-26 17:28 |
CR_DECLARE(TCls=AAirMoveType) expands to static creg::ClassBinder binder; typedef TCls MyType; static creg::IMemberRegistrator* memberRegistrator; static void _ConstructInstance(void* d); static void _DestructInstance(void* d); friend struct TCls##MemberRegistrator; inline static creg::Class* StaticClass() { return binder.class_; } virtual creg::Class* GetClass() const; static bool creg_hasVTable; static const bool creg_isStruct = false; CR_BIND_DERIVED_INTERFACE(TCls=AAirMoveType, TBase=AMoveType) expands to bool TCls::creg_hasVTable = std::is_polymorphic<TCls>::value; creg::IMemberRegistrator* TCls::memberRegistrator=0; creg::Class* TCls::GetClass() const { return binder.class_; } creg::ClassBinder TCls::binder(#TCls, (unsigned int)creg::CF_Abstract, &TBase::binder, &TCls::memberRegistrator, sizeof(TCls), alignof(TCls), TCls::creg_hasVTable, TCls::creg_isStruct, 0, 0); TCls::GetClass is an instance member which should not be possible to call for abstract classes, so I wonder why the CR_BIND_DERIVED_INTERFACE macro adds a definition for it. |
abma (administrator) 2015-08-26 18:43 |
isn't the error saying AMoveType::StartMoving(float3,float,float) needs to be implemented? https://github.com/spring/spring/blob/develop/rts/Sim/MoveTypes/MoveType.h#L23 |
Kloot (developer) 2015-08-26 19:33 |
It shouldn't need to be: AMoveType and AAirMoveType are both abstract and never instantiated (except clang seems to think AAirMoveType is, through CR_BIND_DERIVED_INTERFACE). Try manually expanding https://github.com/spring/spring/blob/develop/rts/Sim/MoveTypes/AAirMoveType.cpp#L15 and see which line of the macro triggers the error. |
super mario (reporter) 2015-08-29 18:12 |
This line of code is giving the me the errors creg::ClassBinder TCls::binder(#TCls, (unsigned int)creg::CF_Abstract, &TBase::binder, &TCls::memberRegistrator, sizeof(TCls), alignof(TCls), TCls::creg_hasVTable, TCls::creg_isStruct, 0, 0); The error also appears on the mingw compiler. |
Kloot (developer) 2017-05-03 00:43 |
clang build seems fine now, just 8000 warnings left. |
![]() |
|||
Date Modified | Username | Field | Change |
---|---|---|---|
2015-08-26 15:42 | abma | New Issue | |
2015-08-26 15:42 | abma | Note Added: 0015093 | |
2015-08-26 17:27 | Kloot | Note Added: 0015094 | |
2015-08-26 17:28 | Kloot | Note Edited: 0015094 | View Revisions |
2015-08-26 18:43 | abma | Note Added: 0015095 | |
2015-08-26 19:33 | Kloot | Note Added: 0015096 | |
2015-08-29 18:12 | super mario | Note Added: 0015103 | |
2015-09-17 11:39 | abma | Target Version | 101.0 => |
2017-05-03 00:43 | Kloot | Status | new => closed |
2017-05-03 00:43 | Kloot | Resolution | open => fixed |
2017-05-03 00:43 | Kloot | Fixed in Version | => 103.0 +git |
2017-05-03 00:43 | Kloot | Note Added: 0017553 |