Take care that you implement the static create-function for your own classes. For example this class works for cocos2d::Vector
class MySprite : public cocos2d::Sprite
static MySprite* MySprite::create(const char* name)
MySprite* spr = new MySprite();
// your own stuff
And then it's totally ok to do:
auto mysprite = MySprite::create("HelloWorld.png");
Reason why you need to implement the create method is, that you create vectors of your derived class type, but the default create method returns parent class type, which is not convertible to your derived class type.