gustavogenovese / curl-android-ios

Static libcurl to be used in Android and iOS apps. Build scripts included. No Android source required
641 stars 255 forks source link

add missing files to fix undefined reference #27

Closed eaglewangy closed 7 years ago

eaglewangy commented 8 years ago

when adding prebuilt libcurl.a to android app, it will report undefined reference compile error.

alibitek commented 8 years ago

Had the same problem:

Error:FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:externalNativeBuildDebug'.
> Build command failed.
  Error while executing '/home/alpha/Software/Android/android-sdk/cmake/3.6.3155560/bin/cmake' with arguments {--build /home/alpha/Projects/Me/Android/Certificates/app/.externalNativeBuild/cmake/debug/armeabi --target native-lib}
  [1/3] Building CXX object CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o
  [2/3] Building CXX object CMakeFiles/native-lib.dir/src/main/cpp/Curl.cpp.o
  [3/3] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/armeabi/libnative-lib.so
  FAILED: : && /home/alpha/Software/Android/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++  -target armv5te-none-linux-androideabi -gcc-toolchain /home/alpha/Software/Android/android-sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/home/alpha/Software/Android/android-sdk/ndk-bundle/platforms/android-16/arch-arm -fPIC -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -std=c++11 -O0 -fno-limit-debug-info -O0 -fno-limit-debug-info  -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libnative-lib.so -o ../../../../build/intermediates/cmake/debug/obj/armeabi/libnative-lib.so CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/Curl.cpp.o  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a -landroid /home/alpha/Software/Android/android-sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/liblog.so -lz -lm "/home/alpha/Software/Android/android-sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/libgnustl_static.a" "-latomic" && :
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(url.o):function Curl_disconnect: error: undefined reference to 'Curl_http_ntlm_cleanup'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(http.o):function output_auth_headers: error: undefined reference to 'Curl_output_ntlm'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(http.o):function Curl_http_input_auth: error: undefined reference to 'Curl_auth_is_ntlm_supported'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(http.o):function Curl_http_input_auth: error: undefined reference to 'Curl_input_ntlm'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(http.o):function Curl_http_input_auth: error: undefined reference to 'Curl_auth_is_digest_supported'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(http_digest.o):function Curl_input_digest: error: undefined reference to 'Curl_auth_decode_digest_http_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(http_digest.o):function Curl_output_digest: error: undefined reference to 'Curl_auth_create_digest_http_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(http_digest.o):function Curl_digest_cleanup: error: undefined reference to 'Curl_auth_digest_cleanup'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(http_digest.o):function Curl_digest_cleanup: error: undefined reference to 'Curl_auth_digest_cleanup'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_cleanup: error: undefined reference to 'Curl_auth_ntlm_cleanup'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_start: error: undefined reference to 'Curl_auth_is_digest_supported'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_start: error: undefined reference to 'Curl_auth_is_ntlm_supported'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_start: error: undefined reference to 'Curl_auth_create_ntlm_type1_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_start: error: undefined reference to 'Curl_auth_create_external_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_start: error: undefined reference to 'Curl_auth_create_oauth_bearer_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_start: error: undefined reference to 'Curl_auth_create_oauth_bearer_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_start: error: undefined reference to 'Curl_auth_create_plain_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_start: error: undefined reference to 'Curl_auth_create_login_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_continue: error: undefined reference to 'Curl_auth_create_plain_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_continue: error: undefined reference to 'Curl_auth_create_login_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_continue: error: undefined reference to 'Curl_auth_create_login_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_continue: error: undefined reference to 'Curl_auth_create_external_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_continue: error: undefined reference to 'Curl_auth_decode_cram_md5_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_continue: error: undefined reference to 'Curl_auth_create_cram_md5_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_continue: error: undefined reference to 'Curl_auth_create_digest_md5_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_continue: error: undefined reference to 'Curl_auth_create_ntlm_type1_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_continue: error: undefined reference to 'Curl_auth_decode_ntlm_type2_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_continue: error: undefined reference to 'Curl_auth_create_ntlm_type3_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_continue: error: undefined reference to 'Curl_auth_create_oauth_bearer_message'
  ../../../../../curl/prebuilt-with-ssl/android/armeabi/libcurl.a(curl_sasl.o):function Curl_sasl_continue: error: undefined reference to 'Curl_auth_create_oauth_bearer_message'
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  ninja: build stopped: subcommand failed.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
eaglewangy commented 8 years ago

@gcesarmza Would you kind please take look at this pull request? thanks