我正在尝试在我的 NDK 应用程序中构建 Openssl。即使遵循了 Android ndk build 所期望的所有必要步骤,我也经常遇到链接错误。我正在将 ndk-build 命令与 ndk 支持的库一起使用。我可以看到 libcrypto.So bieng 编译和链接成功
Compile thumb : crypto <= sha512-armv4.S
SharedLibrary : libcrypto.so
Install : libcrypto.so => /Users/<me>/Downloads/paddybyers-openssl-android-2b40b8b/libs/armeabi/libcrypto.so
但是在此之后启动的openssl由于某种原因失败了。我尝试了所有可能的方式,包括在eclipse和命令行上构建。我什至尝试将openssl单独构建为一个独立的项目。但它总是停在同一水平线上。
- 我的配置:
使用 mac OS x NDK r8 Openssl 源来自:https ://github.com/eighthave/openssl-android.git (我尝试在guardproject https://github.com/guardianproject/openssl-android.git上构建)
它在创建 libcrypto.So 后开始编译 openssl 之前抛出错误
****Compile thumb : ssl <= ssl_algs.c
Compile thumb : ssl <= bio_ssl.c
Compile thumb : ssl <= ssl_err.c
Compile thumb : ssl <= kssl.c
SharedLibrary : libssl.so
Executable : openssl
/Users/me/Documents/android/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld: warning: libz.so, needed by ./obj/local/armeabi/libcrypto.so, not found (try using -rpath or -rpath-link)
./obj/local/armeabi/libcrypto.so: undefined reference to `zError'
./obj/local/armeabi/libcrypto.so: undefined reference to `inflateEnd'
./obj/local/armeabi/libcrypto.so: undefined reference to `deflate'
./obj/local/armeabi/libcrypto.so: undefined reference to `deflateInit_'
./obj/local/armeabi/libcrypto.so: undefined reference to `inflate'
./obj/local/armeabi/libcrypto.so: undefined reference to `deflateEnd'
./obj/local/armeabi/libcrypto.so: undefined reference to `inflateInit_'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/openssl] Error 1**** }
如果有人帮助我解决这个问题,我将不胜感激?