okay, i did that.
now while compiling i get a strange error i dont understand:
i use the following structs and methods:
Code:
typedef struct{
double d; //Distanz
int c; //Klassentyp
}tknnclassify;
using namespace std;
typedef list<tfingertip> FINGERLIST;
typedef list<tknnclassify> CLASSIFYLIST;
//prototypes
bool ccompare(tknnclassify, tknnclassify);
int kclassify(int, int, int);
bool ccompare(tknnclassify& a, tknnclassify& b)
{
return a.d < b.d;
}
int kclassify(int rx, int ry, int k){
CLASSIFYLIST cl;
double dist;
int z = 1;
int f1 = 0;
int f2 = 0;
int f3 = 0;
int f4 = 0;
int f5 = 0;
typedef FINGERLIST::const_iterator fliter;
for(fliter i = flist.begin();i != flist.end();++i){
dist = computeD(rx, ry, i->x, i->y);
tknnclassify tkc = {dist, i->c};
cl.push_back(tkc);
}
cl.sort(ccompare);
.
.
.
}
//i know this method is dumb progged
double computeD(int rx, int ry, int listx, int listy){
double ret;
double tx;
double ty;
double tt;
double p1;
double p2;
tx = rx - listx;
ty = ry - listy;
p1 = pow(tx, 2);
p2 = pow(ty, 2);
tt = p1 + p2;
ret = sqrt(tt);
return ret;
}
When i go for compiling then it says:
/tmp/ccsxkW2X.o(.text+0x1819): In function `kclassify(int, int, int)':
: undefined reference to `ccompare(tknnclassify, tknnclassify)'
collect2: ld returned 1 exit status
Who can help me there?
Thanks in advance!
~Jan