An "undefined reference" error comes from the linker. Your header file only satisfied the compiler.
However, since you are mixing C and C++ your problem is likely name mangling. Basically, you need to tell the C++ compiler that the function you are trying to call was created by a C compiler rather than a C++ one, and so does not have argument type codes grafted onto its name. Right now it doesn't know that, so is trying to call the function by a C++ style decorated name which differs from the plain C name of the function the linker actually has available.
Add this at the beginning of your gesture_detector.h file:
#ifdef __cplusplus
extern "C" {
#endif
And this at the end
#ifdef __cplusplus
}
#endif
And do a clean rebuild.
If your real jni glue logic is as trivial as the version presented here, switching to a C version of that could also be an option - but beware that jni syntax is different in C and C++, so you can't just change the file extension.