Let's try to understand the error message.
int (__thiscall GameController::* )(const void *,const void *)
You are trying to pass address of a member function whose return type is int
and takes inputs of type const void *
. The word __thiscall
signifies that you are passing a C++ member function and has the hidden this
argument during the calls.
int (__cdecl *)(const void *,const void *)
__cdecl *
signifies that it expects a plain C
function as a call back. Notice that it has no knowledge about the hidden argument this
.
So, you are a passing a C++
member function while the qsort
expects a C
type function as a predicate.
You can convert the function to static which will resolve the issue.