本文介绍了NDK:如何包括prebuilt共享库无论建筑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在移植Box2D的了解更多一些关于Android的移植工作。

I am working on porting Box2D to learn a little more about android porting.

我能得到这个项目编制和我看到下面的....

I can get the project compiling and I see the following....

LS库/

armeabi armeabi-V7A

armeabi armeabi-v7a

现在我想要做类似<一个href=\"http://stackoverflow.com/questions/7927210/how-to-include-$p$pbuilt-shared-libraries-in-apk-with-eclipse\">this但我不知道如何使它足够聪明的选择弓(说我想补充的x86)。我如何包含的.so没有硬编码的.so路径,一个规范拱?

Now I want to do something like this but i don't know how to make it smart enough to choose arch (say I wanted to add x86). How do I include the .so without hard coding the .so path to a spec arch?

推荐答案

这工作...

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := box2D-prebuilt
LOCAL_SRC_FILES := ../Box2D/libs/$(TARGET_ARCH_ABI)/libbox2D.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/..
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE    := box2DHello
LOCAL_SRC_FILES := \
    $(subst $(LOCAL_PATH)/,, \
    $(wildcard $(LOCAL_PATH)/*.cpp))
LOCAL_LDLIBS := -lm -llog
LOCAL_SHARED_LIBRARIES := box2D-prebuilt
include $(BUILD_SHARED_LIBRARY)

这篇关于NDK:如何包括prebuilt共享库无论建筑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 15:09