porting IOS game to Android - 'm_tAnchorPointInPoints' was not declared in this scope

Hi all,

I’m trying to port cocos2d game to android, but when i compile with build_native.sh it give me below error, could you help on this issue?

Thank you.

Compile*+ thumb : game_shared <= main.cpp
Compile*+ thumb : game_shared <= AppDelegate.cpp
Compile++ thumb : game_shared <= HelloWorldScene.cpp
jni/…/…/Classes/HelloWorldScene.cpp: In member function ‘virtual cocos2d::CCAffineTransform PhysicsSprite::nodeToParentTransform()’:
jni/…/…/Classes/HelloWorldScene.cpp:48:14: error: ‘m_tAnchorPointInPoints’ was not declared in this scope
jni/…/…/Classes/HelloWorldScene.cpp:57:11: error: ‘m_tAnchorPointInPoints’ was not declared in this scope
jni/…/…/Classes/HelloWorldScene.cpp:63:5: error: ‘m_tTransform’ was not declared in this scope
make: * [obj/local/armeabi/objs/game_shared///Classes/HelloWorldScene.o] Error 1

Is there nooneelse to know what this is the problem? :frowning:

Hi, I had the same problem. I had to modify the code slightly.

  1. I defined my own CCAffineTransform and used and returned that.

  2. I used getAnchorPointInPoints to get the anchor point.

So the new code was like this:

CCAffineTransform PhysicsSprite::nodeToParentTransform(void)
{

CCAffineTransform m2;

b2Vec2 pos = m_pBody~~>GetPosition;
CCPoint p = this~~>getAnchorPointInPoints();

float x = pos.x * PTM_RATIO;
float y = pos.y * PTM_RATIO;

if ( isIgnoreAnchorPointForPosition() ) {
x = p.x;
y
= p.y;
}

// Make matrix
float radians = m_pBody~~>GetAngle;
float c = cosf;
float s = sinf;
if ){
x = c*~~p.x +~~s**~~p.y;
y += s*~~p.x* c*~~p.y;
}

m2 = CCAffineTransformMake( c, s,
-s, c,
x, y );

return m2;
}