android/frameworks/native/include/utils/Mutex.h:65: error: undefined reference to ‘android::Mutex::l

  • 2015-01-17
  • 1345℃
Share:

droideabi/bin/ld: /home/zhangbin/zbhome/videoplayer/ffmpeg2/MEAndroid/SoftwareRender/showyuv2/obj/local/armeabi-v7a/objs/ShowYUV2/main.o: in function render(void const*, unsigned int, android::sp<ANativeWindow> const&, int, int):/home/zhangbin/alex/NUStore/x19/android/frameworks/native/include/utils/Mutex.h:65: error: undefined reference to ‘android::Mutex::lock()’

参考 http://stackoverflow.com/questions/10984001/android-ndk-undefined-reference-to-androidmutex-androidaudiotrack

This plagued me as well – but I finally resolved it by linking with Bionic’s header (bionic/libc/include), and – the important part – #define’ing HAVE_PTHREADS (i.e. add LOCAL_CFLAGS += HAVE_PTHREADS).

参考 http://blog.csdn.net/keensword007/article/details/5720636

在Android.mk中,加入

LOCAL_CXXFLAGS := -DHAVE_PTHREADS

就ok了!

最新
业务QQ