Stack Exchange
Pointers to members have different representations; cannot cast between them cocos2d-x
x and new to programming too, i'm making a reversi but some way its give me an error.
can anyone help me?
CCSprite* bg = CCSprite::create("Images/Reversi.png");
addChild(bg, 1);
bg->setAnchorPoint(CCPointZero);

_midArea = CCLayerColor::create(ccc4(255, 0, 0, 0), 600, 600);
addChild(_midArea, 2);
_midArea->setAnchorPoint(CCPointZero);
_midArea->setPosition(ccp(88, 271));

CCMenu* menu = CCMenu::create();
_midArea->addChild(menu, 10);
menu->setAnchorPoint(ccp(0, 0));
menu->setPosition(ccp(0, 0));

_gameOver = CCMenuItem::create();
_gameOver->setTarget(this, menu_selector(GameLayer::startNewGame));
menu->addChild(_gameOver);
_gameOver->setAnchorPoint(ccp(0.5, 0.5));
_gameOver->setPosition(ccp(300, 300));
_gameOver->setContentSize(getContentSize());
CCSprite* overImg = CCSprite::create("Images/GameOver.png");
_gameOver->addChild(overImg);
CCSize layerSize = getContentSize();
overImg->setPosition(ccp(layerSize.width / 2, layerSize.height / 2));
_gameOver->setVisible(false);
_gameOver->setEnabled(false);

float gridSize = 75;

CCTextureCache* textureCache = CCTextureCache::sharedTextureCache();

_whiteTex = textureCache->addImage("Images/ReversiWhitePiece.png");
_blackTex = textureCache->addImage("Images/ReversiBlackPiece.png");
_whiteTex->retain();
_blackTex->retain();

for (int i = 0; i < NUM_ROW; i++) {
    for (int j = 0; j < NUM_COL; j++) {
        CCMenuItem* item = CCMenuItem::create();
        item->setContentSize(CCSizeMake(gridSize, gridSize));
        menu->addChild(item);
        item->setTarget(this, menu_selector(GameLayer::onClickGrid));
        item->setTag(i * NUM_COL + j);
        item->setAnchorPoint(ccp(0, 0));
        item->setPosition(ccp(j * gridSize, i * gridSize));

        _gridSprites[i][j] = CCSprite::createWithTexture(_whiteTex);
        _midArea->addChild(_gridSprites[i][j], 2);
        _gridSprites[i][j]->setVisible(false);
        _gridSprites[i][j]->setAnchorPoint(item->getAnchorPoint());
        _gridSprites[i][j]->setPosition(item->getPosition());

        _grids[i][j] = FLAG_NONE;

        if ((i == 3 && j == 3) || (i == 4 && j == 4)) {
            _grids[i][j] = FLAG_BLACK;
            _blackCount++;
            _gridSprites[i][j]->setTexture(_blackTex);
            _gridSprites[i][j]->setVisible(true);
        }
        else if ((i == 3 && j == 4) || (i == 4 && j == 3)) {
            _grids[i][j] = FLAG_WHITE;
            _whiteCount++;
            _gridSprites[i][j]->setTexture(_whiteTex);
            _gridSprites[i][j]->setVisible(true);
        }
    }
}

_curFlag = FLAG_BLACK;
_curFlagSprite = CCSprite::createWithTexture(_blackTex);
_midArea->addChild(_curFlagSprite, 1);
_curFlagSprite->setAnchorPoint(ccp(0, 0));
_curFlagSprite->setPosition(ccp(7 * 75, 75 * 8 + 25));

setKeypadEnabled(true);

scheduleUpdate();

printf("GameLayer::init whiteCount %d, blackCount %d\n", _whiteCount,
    _blackCount);

return true;

and this is an error 
1>e:\games\game maker\cocos2d-x-2.2.6\cocos2d-x-2.2.6\projects\reversi2\classes\gamescene.cpp(48): error C2440: 'type cast' : cannot convert from 'void (__thiscall GameLayer::* )(cocos2d::CCNode *)' to 'cocos2d::SEL_MenuHandler'Pointers to members have different representations; cannot cast between them

and then its give me this too
1>e:\games\game maker\cocos2d-x-2.2.6\cocos2d-x-2.2.6\projects\reversi2\classes\gamescene.cpp(48): error C2660: 'cocos2d::CCMenuItem::setTarget' : function does not take 1 arguments

sorry english is not my mother leanguage so hope you all understand :v

I don't remember the solution, i think it was about a typecast :)

thanks Nande and all of your Instruction is very very great :D with CCNode       change it as CCObject and getTag has been edited, :D and all problem is solved thanks :D

@Nande you are wrong on this one. CCLayer is a sub class of CCNode. so yea it does inherit from CCNode.
