我试图通过将其保留在android源代码树中,在android 4.0.4的本机代码中使用硬件解码器(OMX编解码器)构建用于h.264视频解码的代码。android源代码已构建。我正在使用mm命令来构建我的解码器模块。
但是当我尝试构建它时,出现以下错误
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld:
out/target/product/generic/obj/SHARED_LIBRARIES/custom_decoder_intermediates/custom_decoder.o:
in function custom_decoder::decode_video():frameworks/base/include/utils/RefBase.h:171:
error: undefined reference to 'android_atomic_dec'
当我探索它时,才知道android_atomic_dec是在cutils / atomic.h中定义的,该文件位于system / core / libcutils中,并且标头位于AOSP 4.0.4的system / core / include / cutils中。
所以我也通过LOCAL_C_INCLUDES在我的android.mk中添加了它,但仍然得到相同的错误。
有人可以帮我解决这个问题吗?
您必须添加cutils到联动阶段:
LOCAL_LDLIBS += -L $(path-to-system-libs) -lcutils
如果要构建AOSP树,请改用以下内容:
LOCAL_SHARED_LIBRARIES += libcutils
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句