gpg :: MD5(char const *,int):错误:未定义引用' MD5_Init'

时间:2014-09-07 03:40:13

标签: android c++ android-ndk google-play-services

当我使用NDK R10(最新版本)编译google play服务示例极简主义时,我遇到了这些错误,我尝试使用LOCAL_STATIC_LIBRARIES,但错误仍然相同。

Android NDK: WARNING:jni/Android.mk:native-activity: non-system libraries in lin
ker flags: -lgnustl_static
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_S
TATIC_LIBRARIES
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependenc
ies of the
Android NDK:     current module
[armeabi] Compile++ thumb: native-activity <= main.cpp
[armeabi] Compile++ thumb: native-activity <= StateManager.cpp
[armeabi] Compile thumb  : android_native_app_glue <= android_native_app_glue.c
[armeabi] StaticLibrary  : libandroid_native_app_glue.a
[armeabi] SharedLibrary  : libnative-activity.so
jni/../../gpg-cpp-sdk/android/lib/gnustl/armeabi/libgpg.a:turn_based_match_impl.
pb.cc:function gpg::MD5(char const*, int): error: undefined reference to 'MD5_In
it'
jni/../../gpg-cpp-sdk/android/lib/gnustl/armeabi/libgpg.a:turn_based_match_impl.
pb.cc:function gpg::MD5(char const*, int): error: undefined reference to 'MD5_Up
date'
jni/../../gpg-cpp-sdk/android/lib/gnustl/armeabi/libgpg.a:turn_based_match_impl.
pb.cc:function gpg::MD5(char const*, int): error: undefined reference to 'MD5_Fi
nal'
jni/../../gpg-cpp-sdk/android/lib/gnustl/armeabi/libgpg.a:turn_based_match_impl.
pb.cc:function gpg::ContentMD5AtPath(std::string const&, std::string const&): er
ror: undefined reference to 'MD5_Init'
jni/../../gpg-cpp-sdk/android/lib/gnustl/armeabi/libgpg.a:turn_based_match_impl.
pb.cc:function gpg::ContentMD5AtPath(std::string const&, std::string const&): er
ror: undefined reference to 'MD5_Update'
jni/../../gpg-cpp-sdk/android/lib/gnustl/armeabi/libgpg.a:turn_based_match_impl.
pb.cc:function gpg::ContentMD5AtPath(std::string const&, std::string const&): er
ror: undefined reference to 'MD5_Final'

谢谢。

2 个答案:

答案 0 :(得分:0)

我通过将sdk和ndk重新安装到&#34; 32位平台版本&#34;来解决了这个问题。 它导致错误,因为我编译了&#34; android-ndk64-r10-windows-x86&#34; (64位平台32位目标)。我想在这个包中可能没有md5 lib。 尝试使用&#34; android-ndk32-r10-windows-x86&#34;。

答案 1 :(得分:0)

MD5已从Lollipop的libc中删除,请参阅 discussion 。它从来都不是libc的一部分。你可以在libcrypto中找到md5,或者自己编译。