我下載提供的libcrypto.a
編譯過不了,錯誤訊息
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libcrypto.a(threads_pthread.o): In function CRYPTO_THREAD_lock_new': (.text+0x25): undefined reference topthread_rwlock_init'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libcrypto.a(threads_pthread.o): In function CRYPTO_THREAD_read_lock': (.text+0x55): undefined reference topthread_rwlock_rdlock'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libcrypto.a(threads_pthread.o): In function CRYPTO_THREAD_write_lock': (.text+0x75): undefined reference topthread_rwlock_wrlock'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libcrypto.a(threads_pthread.o): In function CRYPTO_THREAD_unlock': (.text+0x95): undefined reference topthread_rwlock_unlock'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libcrypto.a(threads_pthread.o): In function CRYPTO_THREAD_lock_free': (.text+0xba): undefined reference topthread_rwlock_destroy'
下面是我的Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := opensslcrypto
LOCAL_SRC_FILES := ../../../src/util/libcrypto.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := openssl
LOCAL_SRC_FILES := ../../../src/util/libssl.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := curl
LOCAL_SRC_FILES := ../../../src/util/libcurl.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := util
LOCAL_MODULEFILENAME := $(prefix)$(LOCAL_MODULE)
Android supports pthreads strating from API 9 version. i got the above error due to i am using old version of NDK. to avoid this build like this "$ndk-build APP_PLATFORM=android-9 "
我下載提供的libcrypto.a 編譯過不了,錯誤訊息 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libcrypto.a(threads_pthread.o): In function
CRYPTO_THREAD_lock_new': (.text+0x25): undefined reference to
pthread_rwlock_init' /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libcrypto.a(threads_pthread.o): In functionCRYPTO_THREAD_read_lock': (.text+0x55): undefined reference to
pthread_rwlock_rdlock' /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libcrypto.a(threads_pthread.o): In functionCRYPTO_THREAD_write_lock': (.text+0x75): undefined reference to
pthread_rwlock_wrlock' /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libcrypto.a(threads_pthread.o): In functionCRYPTO_THREAD_unlock': (.text+0x95): undefined reference to
pthread_rwlock_unlock' /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libcrypto.a(threads_pthread.o): In functionCRYPTO_THREAD_lock_free': (.text+0xba): undefined reference to
pthread_rwlock_destroy' 下面是我的Android.mk LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS) LOCAL_MODULE := opensslcrypto LOCAL_SRC_FILES := ../../../src/util/libcrypto.a include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS) LOCAL_MODULE := openssl LOCAL_SRC_FILES := ../../../src/util/libssl.a include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS) LOCAL_MODULE := curl LOCAL_SRC_FILES := ../../../src/util/libcurl.a include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS) LOCAL_MODULE := util LOCAL_MODULEFILENAME := $(prefix)$(LOCAL_MODULE)
LOCAL_SRC_FILES := $(src_root)/util.cpp LOCAL_SRC_FILES += $(src_root)/ecc.cpp LOCAL_SRC_FILES += $(src_root)/ecdsa_sign.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../syslib/openssl/include LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../syslib/openssl/include/curl
LOCAL_STATIC_LIBRARIES := opensslcrypto LOCAL_STATIC_LIBRARIES += openssl LOCAL_STATIC_LIBRARIES += curl
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
LOCAL_CFLAGS := -fpermissive -w -pthread
LOCAL_LDLIBS := -lz
include $(BUILD_SHARED_LIBRARY) 我有加入-pthread一樣也過不了,請幫幫忙,謝謝