Game Development Community

Couldn't find class rep for dynamic class:

by Steve Lamperti · in Torque Game Engine · 09/09/2003 (12:02 pm) · 5 replies

I am trying to bring up Troque on the Mac (OS X, CW 8.3), and am running into an interesting problem.

I have everything compiled, and linked, and running except for some assertions in the .con file, that I think are preventing me from going further.

I am getting the assertion:

'Couldn't find class rep for dynamic class: '

from the code below for the following classes: GuiFrameSetCtrl, GameTSCtrl, GuiNoMouseCtrl, and GuiInputCtrl.

I've checked, and these classes are not in the classLinkList. I'm not sure why, as they seem to define the abstractClass stuff correctly, as far as I can tell. (Other classes seem to be working fine. )

If anyone has a suggestion why these classes might dehave differently then the others, I would appreciate any hints.

Thanks,

-Steve Lamperti

ConsoleObject* AbstractClassRep::create(const char* in_pClassName)
{
AssertFatal(initialized,
"AbstractClassRep::create() - Tried to create an object before AbstractClassRep::initialize().");

for (AbstractClassRep *walk = classLinkList; walk; walk = walk->nextClass)
if (!dStrcmp(walk->getClassName(), in_pClassName))
return walk->create();

AssertWarn(0, avar("Couldn't find class rep for dynamic class: %s", in_pClassName));
return NULL;
}

#1
09/09/2003 (12:52 pm)
This probably implies there's a mistype or that you didn't actually link everything into the app. Are those classes consoleInit() methods being called?
#2
09/09/2003 (2:44 pm)
None of the four classes had a consolInit message handler, so I added one to GuiInputCtrl. It didn't get called. All four objects are included in the project, and are compiling successfully, and linking successfully. Perhaps I should look for some kind of smart linker option that removes objects that are not referenced by specific calls from the code?
#3
09/09/2003 (2:56 pm)
The consoleInit function should be called. Are there proper DECLARE_CONOBJECT and IMPLEMENT_CONOBJECT macros for those classes?
#4
09/09/2003 (2:56 pm)
I found an option called 'Dead strip Static Initialization code.' This was turned on, and I've turned it off. I an now getting a call to my consoleInit Method in GuiInputCtrl. (Also a crash, which I will need to investigate further.)


Edit - turning off this option definately was necessary. Thanks for the help, that seems to have cleared up my assertions.
#5
04/18/2014 (7:57 pm)
i have met the same question and now i conquer it。 you can use following ways(i use vs 2012,but i guess the way is same to vs 2010 or lower version.
1.clean and recompile the source code.this may take you long time.

2.re-start the exe . i met a problem which said"non-object" and so on,but when i re-start the problem has gone .maybe this is because it has;t updated. try it