Member function declared, but compiler says its not
This is my Position.h file:
#ifndef POSITION_H_
#define POSITION_H_
class Position{
public:
Position(int v);
int pos();
private:
int value;
bool win;
};
#endif
This is my Position.cpp file:
#include "Position.h"
Position::Position(int v):value(v){
}
int Position::pos(){
return value;
}
My error is:
Position.cpp:8: error: no 'int Position::pos()' member function declared in class 'Position'
I've been trying to fix this for hours and the function is declared. I don't 开发者_JS百科understand why this wont compile.
Its compiling for me... you must be doing something weird.
精彩评论