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.youkuaiyun.com/keensword007/article/details/5720636 塔机配件大全
在Android.mk中,加入
LOCAL_CXXFLAGS := -DHAVE_PTHREADS
就ok了!