for a university project I'm doing a port of a handtracking algorithm for Android. The alg. mainly uses OpenCV functions. Honestly I don't really understand what the alg. does but this is not my problem.
So for porting the alg. I added every file from a working windows visual studio project to my android project fixing some compiler warnings and errors here and there. Mostly with success...
Unfortunaly there is one file that worries me for many many hours.
Compiling this file throws following errors:

```
./obj/local/armeabi-v7a/libopencv_legacy.a(compat.o): In function `cvFindChessBoardCornerGuesses':
compat.cpp:(.text.cvFindChessBoardCornerGuesses+0x18): undefined reference to `cvFindChessboardCorners'
./obj/local/armeabi-v7a/libopencv_legacy.a(compat.o): In function `cvHoughLines':
compat.cpp:(.text.cvHoughLines+0x46): undefined reference to `cvHoughLines2'
./obj/local/armeabi-v7a/libopencv_legacy.a(compat.o): In function `cvHoughLinesSDiv':
compat.cpp:(.text.cvHoughLinesSDiv+0x54): undefined reference to `cvHoughLines2'
./obj/local/armeabi-v7a/libopencv_legacy.a(compat.o): In function `cvHoughLinesP':
compat.cpp:(.text.cvHoughLinesP+0x52): undefined reference to `cvHoughLines2'
./obj/local/armeabi-v7a/libopencv_legacy.a(compat.o): In function `cvCalcEMD':
compat.cpp:(.text.cvCalcEMD+0x44): undefined reference to `cvCalcEMD2'
collect2: ld returned 1 exit status

```

The funny thing about that is that the only line causing this error is

```
nPointsConnected ++;

```

Commenting this line or decrementing nPointsConnected or setting a value like nPointsConnected=1 makes the linker error disappear.

There are other files in the project including the same OpenCV headers compiling fine.
Could anybody please explain this to me? 
please...

EDIT
This is the surround code:

```
 if ( minK > FINGERTIP_ANGLE_THRESHOLD && minDir > 0 )
    {
        nPointsGap = 0;
        if ( nPointsConnected == 0 )
            {
                startIndex = i;
            }

        nPointsConnected ++;
        if ( minAngle < minK )
        {
            minAngle = minK;
            minPointIndex = i;
        }
        fConnected = true;
        mediumIndex += ( minK * i );
        meanPointX += ( minK * contour[i].x );
        meanPointY += ( minK * contour[i].y );
        sumAngle += minK;
        if ( fScreenshot )
        {
            cvCircle( pScreenshot_curvature, cvPoint(contour[i].x*2, contour[i].y*2),
                4, CV_RGB(255,255,0), -1, 8, 0 );
            cvCircle( pScreenshot_ellipse, cvPoint(contour[i].x*2, contour[i].y*2),
                4, CV_RGB(255,255,0), -1, 8, 0 );
        }
    }

```