2013-03-06 76 views
1

ndk-build中的pthread錯誤

我曾嘗試使用ndk-build編譯以下Android.mk文件。

我收到以下錯誤。我該如何解決這個問題?

請幫幫我。

make文件是

# ================================================== ======== 
# NOTE: 
# when executing binary, set LD_LIBRARY_PATH in device 
# ================================================== ======== 

LOCAL_PATH := $(call my-dir) 

include $(CLEAR_VARS) 

BASEDIR := ../../.. 
DISTDIR := ../../../.. 

LOCAL_MODULE := EvaluateFingerQuality 

LOCAL_ARM_MODE := arm 


# Includes 
LOCAL_C_INCLUDES += \ 
$(BASEDIR)/Common/C \ 
$(DISTDIR)/Include 

# Source files 
LOCAL_SRC_FILES := \ 
$(BASEDIR)/Common/C/Utils.c \ 
EvaluateFingerQuality.c 


LOCAL_LDLIBS += \ 
-Wl,-z,muldefs -Wl,-rpath=$(DISTDIR)/Lib/Android_$(TARGET_ARCH_ABI) \ 
-L $(DISTDIR)/Lib/Android_$(TARGET_ARCH_ABI) \ 
-lNLicensing -lNBiometricTools -lNBiometrics -lNMedia -lNCore -lc 

include $(BUILD_EXECUTABLE) 

誤差

$ ndk-build 
Compile arm : EvaluateFingerQuality <= Utils.c 
Compile arm : EvaluateFingerQuality <= EvaluateFingerQuality.c 
Executable : EvaluateFingerQuality 
../../../../Lib/Android_armeabi/libNCore.so: undefined reference to `pthread_rwlock_trywrlock' 
../../../../Lib/Android_armeabi/libNCore.so: undefined reference to `pthread_rwlock_rdlock' 
../../../../Lib/Android_armeabi/libNCore.so: undefined reference to `pthread_rwlock_tryrdlock' 
../../../../Lib/Android_armeabi/libNCore.so: undefined reference to `pthread_rwlock_wrlock' 
../../../../Lib/Android_armeabi/libNCore.so: undefined reference to `dladdr' 
../../../../Lib/Android_armeabi/libNCore.so: undefined reference to `pthread_rwlock_destroy' 
../../../../Lib/Android_armeabi/libNCore.so: undefined reference to `pthread_rwlock_init' 
../../../../Lib/Android_armeabi/libNCore.so: undefined reference to `pthread_rwlock_unlock' 
collect2: ld returned 1 exit status 
/cygdrive/d/android-ndk-r8-windows/android-ndk-r8/build/core/build-binary.mk:381: recipe for target `/cygdrive/d/MegaMatcher_Embedded_1_2_SDK_Trial_for_Android/Tutorials/BiometricTools/C/obj/local/armeabi/EvaluateFingerQuality' failed 
make: *** [/cygdrive/d/MegaMatcher_Embedded_1_2_SDK_Trial_for_Android/Tutorials/BiometricTools/C/obj/local/armeabi/EvaluateFingerQuality] Error 1 
+0

如果將目標更改爲x86,是否也有同樣的問題? – zoli2k 2013-03-06 08:09:41

+0

@ zoli2k我是新來的機器人和可執行文件編譯爲Android only.i無法得到你所說的 – Siva 2013-03-06 09:30:32

+0

@ zoli2k另外一件事情,它是審判SDK的Android試用版。他們只爲android提供依賴 – Siva 2013-03-06 09:40:22

回答

4

Android支持並行線程從API strating 9版本。由於我使用舊版本的NDK,我得到了上述錯誤。以避免這種構建像這樣「$ ndk-build APP_PLATFORM = android-9」