L.witko Posted January 21, 2011 Share Posted January 21, 2011 In a part of code: Unigine::ArrayMap NodeMap = Unigine::Interpreter::getArrayMap(_nodeMap); int size = NodeMap.size(); for(int id=0; id < size; id++ ) { Unigine::Node* nodePtr = (Unigine::Node*) NodeMap.get( Unigine::Variable( id ) ).getExternClassObject( Unigine::TypeInfo( Unigine::TypeID<Unigine::Node*>() ) ); ... } getExternClassObject causes an error: "Variable::getExternClassObject(): can't convert extern class to class Unigine::Node *" Condition (type_info == TypeInfo(TypeID<Node*>())) in Variable::getExternClassObject(const TypeInfo &type_info) is false, but both names in TypeInfo's are the same "class Unigine::Node *", the problem is they have different ids. This is probably caused by initialization of template <class Type> int TypeID<Type>::id = get_type_id(); in a header (UnigineType.h) - there are two separate instances of TypeID<Unigine::Node*>::id, one in a dll and one in executable. Link to comment
rohit.gonsalves_ Posted January 25, 2011 Share Posted January 25, 2011 Hello, Check source\samples\Api\Nodes sample. Create exe and load the nodes.world. You will get following error. The error is the same reason as of this discussion. TypeInfo. Please anyone answer this from Unigine team? Its a serious bug. Link to comment
frustum Posted January 25, 2011 Share Posted January 25, 2011 Thank you for this crucial bug. Visual studio has own opinion on templates instantiation order. There was no error on gcc. Link to comment
Recommended Posts