1

I have a third-party library written by C and I want to use it in my Android project by JNI. The issue is that a error occured when I compile it like below:

error: undefined reference to 'pthread_testcancel'

and the code is

#if !defined(WIN32) && !defined (WINCE) && !defined(ITRON) && !defined(BTRON) && !defined(TENGINE) && !defined(PROCESS_BASE)
  pthread_testcancel();
#endif

And only this method compile failed, some other methods are all ok like pthread_kill, pthread_join, pthread_create...

Anybody can help me to resolve it? Thanks very well.

Mohan
  • 1,871
  • 21
  • 34
Mars_win
  • 29
  • 7

1 Answers1

1

Android's NDK doesn't support pthread_cancel due to the complexity also implementation of it is error prone and harmful to performance (of all code). so you can have look on pthread_cancel() alternatives in Android NDK.

Community
  • 1
  • 1
Mohan
  • 1,871
  • 21
  • 34