我正在写一个关于 alpha-beta 修剪的项目。当我在 xcode 中运行它时,我得到符号引用错误:
Undefined symbols for architecture x86_64:
"Eval(Node*)", referenced from:
AlphaBeta(int, int&, int, int, int, Node*) in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我的一些代码:
struct Node
{
char name[1];
int empty;// YES or NO
double value;
};
int eval(Node ptr[]) {
//some stuff
}
int AlphaBeta (int player, int &bestMove, int alpha, int beta, int bsize, Node ptr[]) {
//some stuff, and then i call Evaluation function
int value = Eval(ptr);
//some stuff
}
int main (int argc, const char * argv[])
{
int size = 4;
Node board[size*size];
// some stuff
int score = AlphaBeta(RED, move, a, b, size, board);
return 0;
}