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

gpg::MD5(char const*, int): error: undefined reference to 'MD5_Init'

本文关键字:MD5 Init 引用 未定义 const char gpg int 错误      更新时间:2023-10-16

当我使用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'

谢谢。

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

MD5已从棒棒糖中的libc中删除,请参阅讨论。它从来都不是libc的一部分。您可以在libcrypto中找到md5,也可以自己编译它。