gpg::MD5(char const*, int): 错误: 未定义对'MD5_Init'的引用
gpg::MD5(char const*, int): error: undefined reference to 'MD5_Init'
当我使用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,也可以自己编译它。
相关文章:
- GCC对可能有效的代码抛出init list生存期警告
- GLEW/GLUT:调用init并创建一个窗口后,取消初始化并重新初始化?
- 将 out/in out 参数与 if/switch 的 init 语句一起使用
- 使用 std::ios_base::Init 正确初始化全局变量
- Pybind11: init<> with lambda
- 为什么别名声明不是有效的 init 语句(/simple-declaration)?
- 在Javascript和C++中计算MD5哈希的不同结果
- 结构 init:字符**类型的标量初始值设定项两边的大括号
- 为什么基于范围类型的大括号上循环init列表是非法的c++
- 是否可以使用"if constexpr"来声明具有不同类型和init-expr的变量
- Android Studio TextView Init C++
- Pc Lint,如何使用 init() 抑制类的 err 613(可能使用空 ponter)
- 带有定制 GLFW 二进制 /usr/bin/ld 的 Centos 7: /usr/local/lib/libglfw3.a(init.c.o):".text"部分中无法识别的重定位 (0x2a)
- md5 inC++ with UTF16LE
- 如何强制调用类的全局实例的析构函数和构造函数(以便"re-init"类实例)
- 当调用时,为什么ranges ::累积的init as std :: Move(init)
- clang tidy pro type member init resharper
- 为什么当我在MD5 Hash中转换相同的C 字符串时,每次都会获得不同的输出
- Android NDK 未定义对 'std::ios_base::Init::Init()' 的引用
- 使用 Git init、fetch 和 checkout 克隆 Git 存储库