Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libpomelo2在android上的编译问题. #48

Closed
huangliop opened this issue Oct 21, 2015 · 1 comment
Closed

libpomelo2在android上的编译问题. #48

huangliop opened this issue Oct 21, 2015 · 1 comment

Comments

@huangliop
Copy link

你好, 我编译的android使用的so文件,在android5上运行没问题,但是在4.0的机型上初始化的是就报错

java.lang.UnsatisfiedLinkError: 
dlopen failed: cannot locate symbol "srand" referenced by "libpomelo.so".

我的NDK用的是10e,后来又换了9d,问题依然.

请问下是不是我修改了 Android.mk文件?
之所以修改是因为用git上的根本编译不能通过,很多依赖都找不到.后来用排除法将所有没有的依赖删除后才编译成功.
下面是我修改后的 Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := pomelo_static

LOCAL_MODULE_FILENAME := libpomelo

LOCAL_SRC_FILES := \
src/pc_JSON.c \
src/pc_lib.c \
src/pc_pomelo.c \
src/pc_trans.c \
src/pc_trans_repo.c \
src/tr/dummy/tr_dummy.c \
src/tr/uv/pb_decode.c \
src/tr/uv/pb_encode.c \
src/tr/uv/pb_i.c \
src/tr/uv/pr_msg.c \
src/tr/uv/pr_msg_json.c \
src/tr/uv/pr_msg_pb.c \
src/tr/uv/pr_pkg.c \
src/tr/uv/tr_uv_tcp.c \
src/tr/uv/tr_uv_tcp_aux.c \
src/tr/uv/tr_uv_tcp_i.c \
java/com_netease_pomelo_Client.c


LOCAL_CFLAGS := -DPC_NO_UV_TLS_TRANS



LOCAL_EXPORT_C_INCLUDES :=$(LOCAL_PATH)/include



LOCAL_C_INCLUDES := $(LOCAL_PATH)/include \
                    $(LOCAL_PATH)/src \
                    $(LOCAL_PATH)/src/tr/dummy \
                    $(LOCAL_PATH)/src/tr/uv

LOCAL_WHOLE_STATIC_LIBRARIES := uv_static jansson_static



include $(BUILD_STATIC_LIBRARY)

LOCAL_CFLAGS    := -D__ANDROID__ 

$(call import-module,libpomelo2/deps/uv) 
@huangliop
Copy link
Author

问题已经解决了, 是我切换到r9d后,重新编译之前没有删除工程下的obj目录.所以要先删除在重新编译

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant