创建Android.mk
cmd-strip = $(TOOLCHAIN_PREFIX)strip --strip-debug -x $1
LOCAL_CFLAGS += -fvisibility=hidden -fexceptions -fno-exceptions -DUNRAR -c -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
LOCAL_ARM_MODE := arm
LOCAL_MODULE:= unrar
LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libcutils libstdc++ libc
生成可执行程序
其中会碰到error
Build error:
- error:
undefined reference to `__cxa_end_cleanup'
undefined reference to `__gxx_personality_v0'
Solution:
Add compile flags -fno-exceptions - error:
undefined reference to 'vtable for __cxxabiv1::__class_type_info'
undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
Solution:
Add compile flags -fno-rtti