Erro - Sprite (createWithSpriteFrames)

Guys, I’m not very familiar with C ++ yet.
Follow the below error

reference to type ‘const Vector<cocos2d::SpriteFrame *>’ could not bind to an lvalue of type ‘CCArray *’ (aka ‘cocos2d::__Array *’)

can someone help?

Are you using cocos2d-x v3.x? If so, there are a couple of things you need to change.

  1. Instead of CCArray, you should be using the new Vector class.
  2. You should additionally remove the “CC” prefixes as these are deprecated.

Something like this:

Vector<SpriteFrame *> ar;
ar.pushBack(sfc->spriteFrameByName("m1.png");
ar.pushBack(sfc->spriteFrameByName("m2.png");
ar.pushBack(sfc->spriteFrameByName("m3.png");
ar.pushBack(sfc->spriteFrameByName("m4.png");
ar.pushBack(sfc->spriteFrameByName("m5.png");
ar.pushBack(sfc->spriteFrameByName("m6.png");

sprite->runAction(
            RepeatForever::create(
            Animate::create(
            Animation::createWithSpriteFrames(ar, 0.15f))));

addChild(sprite);

Worked! Thanks!
Good to know