一直`class`has no member named`XXX`
如題
程式是從別人那邊拿過來的
確定原本可以正確運行
但在我自己的電腦上面跑就出錯
像是其中一個class:
class msb_tree {
bool **bitPlane; //Bits, from top to low [0~tree_depth]
int *width, *height;
int tree_depth;
public:
msb_tree(int baseWidth, int baseHeight);
~msb_tree();
void build() {
bool tmp[4]={false,false,false,false};
int x, y, i, j, k;
for(i=tree_depth-2;i > -1;i--) {
for(y=0;y<height[i];y++)
for(x=0;x<width[i];x++)
{
for(k=0;k<2;k++)
for(j=0;j<2;j++){
if( ((2*x+j) < width[i+1]) && ((2*y+k) < height[i+1] ) )
tmp[k*2+j] = bitPlane[i+1][(2*y+k)*width[i+1]+2*x+j];
else
tmp[k*2+j] = false;
}
bitPlane[i][y*width[i]+x] = bitMax(tmp[0], tmp[1], tmp[2], tmp[3]);
}
}
}
void putLeaf(int x, int y, bool symbol) {
bitPlane[tree_depth-1][y*width[tree_depth-1]+x] = symbol;
}
bool getBit(int level, int x, int y) {
if(x < width[level])
return bitPlane[level][y*width[level]+x];
else
return false;
}
但結果報錯說'class msb_tree' has no member named 'putLeaf'
但明明就是有宣告了啊...