linking errors when using libcurl+openssl

54 views
Skip to first unread message

AnDu

unread,
Jun 21, 2013, 3:43:13 AM6/21/13
to cur...@googlegroups.com
Hello,
I have compiled libcurl with openssl support following these steps:

1. creating standalone tool chain 
      a. /cygdrive/d/android-ndk-r8b-windows/android-ndk-r8b/build/tools/make-standalone-toolchain.sh --ndk-dir=/cygdrive/d/android-ndk-r8b-windows/android-ndk-r8b/ --system=windows --install-dir=/cygdrive/d/android-ndk-r8b-windows/android-ndk-r8b/standalone --platform=android-14 
      b. export PATH=/cygdrive/d/android-ndk-r8b-windows/android-ndk-r8b/standalone/bin:$PATH
2. compiling OpenSSL
      a. download OpenSSL version 1.0.0e
      b. export cross=arm-linux-androideabi-
      c. ./Configure dist
      d. make CC="${cross}gcc" AR="${cross}ar r" RANLIB="${cross}ranlib"
      e. copy the libcrypto.a and libssl.a in a safe location /cygdrive/c/openssl
3. compiling libcurl
      a. download cURL sources  version 7.30.0
      b. ./configure --host=arm-linux-androideabi --with-ssl=/cygdrive/c/openssl --with-random=/dev/urandom --with-sysroot=/cygdrive/d/android-ndk-r8b-windows/android-ndk-r8b/standalone/sysroot
      c. make

I have created a hello world native Android app where I linked the new libcurl static library I have just obtain. But I get the following linking errors:
Gdbserver      : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
Gdbsetup       : libs/armeabi/gdb.setup
"Compile thumb : hello-jni <= hello-jni.c
Prebuilt       : libcurl.a <= jni/curl/lib/armeabi/
SharedLibrary  : libhello-jni.so
./obj/local/armeabi/objs-debug/hello-jni/hello-jni.o: In function `Java_com_example_hellojni_HelloJni_stringFromJNI':
D:\hello-jni/jni/hello-jni.c:32: undefined reference to `curl_version_info'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libhello-jni.so] Error 1

If I compile libcurl without SSL support, the app compiles without problems. 
It seems that the name of the methods in the libcurl+SSL static library are decorated with _.

Does anybody has any idea how can I solve this?
Thanks
Reply all
Reply to author
Forward
0 new messages