LNK2019 error, unresolved external symbol

泪湿孤枕 提交于 2019-12-06 06:32:06

Your current declaration doesn't match the definition.

You probably have declared the function availableMoves() before you use it, but then you implement a different function:

int availableMoves(int* const a, int (* const)[4] , int);


//....
//....
//....
//code that uses available moves


int availableMoves(int a[15], int b[36][3],int openSpace)
{
    //....
}

Since the compiler sees that declaration first, it will use it to resolve the call in the block of code. However, that function is not exported, as it has a different signature.

in solved game

b[36][4]

in available moves

b[36][3]

that could create a problem.

Nice one: you use incompatible array dimensions! Note that part of the error message reads

availableMoves(int *const,int (*const)[4],int)

While the definition of availableMoves() looks like this:

int availableMoves(int a[15], int b[36][3],int openSpace)

Although the first dimension of the arguments is ignored, all other dimensions have to match exactly. You try to call this function with incompatible dimensions, however:

void solveGame(int a[15], int b[36][4]){
    ...
    ... availableMoves(a,b,empSpace) ...
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!