Problem compiling framework with box2D

Problem compiling framework with box2D
0.0 0



If I am normal using cocos2d framework it works fine, but when I

#define CC_USE_BOX2D

instead of CC_USE_CHIPMUNK in CCPhysicsSetting.h i got compile errors:

error C2664: 'cocos2d::PhysicsShapeInfo::PhysicsShapeInfo(const cocos2d::PhysicsShapeInfo &)' : cannot convert parameter 1 from 'cocos2d::PhysicsShape *const ' to 'const cocos2d::PhysicsShapeInfo &' \..\ccphysicsshape.cpp   63
error C2664: 'cocos2d::PhysicsContactInfo::PhysicsContactInfo(const cocos2d::PhysicsContactInfo &)' : cannot convert parameter 1 from 'cocos2d::PhysicsContact *const ' to 'const cocos2d::PhysicsContactInfo &' \..\ccphysicscontact.cpp   70

It is about these parts of code:

bool PhysicsShape::init(PhysicsBody* body, Type type)
    if (body == nullptr) return false;

    _body = body;

    _info = new PhysicsShapeInfo(this);
    if (_info == nullptr) return false;

    _type = type;

    return true;

bool PhysicsContact::init(PhysicsShape* a, PhysicsShape* b)
        CC_BREAK_IF(a == nullptr || b == nullptr);

        CC_BREAK_IF(!(_info = new PhysicsContactInfo(this)));

        _shapeA = a;
        _shapeB = b;

        return true;
    } while(false);

    return false;



I believe you need to pass -DUSE_BOX2D in your compile flags


Unfortunately, didn’t help…


which target platform is this for, linux/mac/windows/android/ios ?


Sorry, forgot to mention it(never worked with multi-platform apps).

I’m running this on windows 7, by using MS Visual Studio.