Private Void
Private Void

Reputation: 317

LNK2019 unresolved external symbol

I am a beginner with C++ working with cocos2dx framework. I am getting an error, that I think might be caused by improper linkage to the function contained in the dll lib.

line 39 in screenshot causes the compiler error (commented out it compiles)

CCSize pixelSize= this->GetGridSize();

CCSize GetGridSize(){
    return CCSize(m_Width*m_CellWidth+m_CellWidth/2,m_Height*m_CellHeight+m_CellHeight/2);
}

void HexGrid::populate(){
    CCSize pixelSize= this->GetGridSize();
    //XDebug::odprintf(L"Grid size in pixels: %d X %d", pixelSize.width, pixelSize.height);

    int i = 0;
    HexCell* pCell;
    for(unsigned int r = 0; r < m_Width; r++){
        for(unsigned int c = 0; c < m_Height; c++){
            pCell = new HexCell(this, r ,c);
            cells.push_back(pCell);
            XDebug::odprintf(L"Adding Cell #%d with grid XY of %dX%d",i++, r, c);
        }
    }
}

What is causing this error and how do i solve it? Any pointers would be appreciated, as i am at wits end googling it.

Upvotes: 0

Views: 332

Answers (1)

ciphor
ciphor

Reputation: 8288

CCSize HexGrid::GetGridSize(){
    return CCSize(m_Width*m_CellWidth+m_CellWidth/2,m_Height*m_CellHeight+m_CellHeight/2);
}

Upvotes: 1

Related Questions