Hello.
I`m having some troubles with colmpiling our iOS project under Windows.
Here s example code:
class Foo
{
virtual void f1(){}
};
class Bar : public Foo, public cocos2d::CCNode
{
public:
Bar() {ptr="S";}
void f2()
{
assert(*ptr=='S'); //acces voilation here
}
private:
char* ptr;
};
//somewhere in code
Bar* bar=new Bar;
bar->runAction( CCCallFunc::actionWithTarget(bar, callfunc_selector(Bar::f2)) );
Program crashes at f2 call, but work correctly under iOS (possibly, with previous version of cocos2dx, without dynamic casts).
If i change inheritance order, program works. If there is no virtual functions in Foo, it works.
On previous versions of cocos2dx i could do
CCCallFunc::actionWithTarget(reinterpret_cast(bar), callfunc_selector(Bar::f2))
but now it crashes even before f2 call.
Is there any solution (exept changing inheritance order)?