libcpr / cpr

C++ Requests: Curl for People, a spiritual port of Python Requests.
https://docs.libcpr.org/
Other
6.62k stars 943 forks source link

Failed to build with ndk #1007

Open Nathan-M-code opened 11 months ago

Nathan-M-code commented 11 months ago

Description

-- Android: Targeting API '21' with architecture 'arm64', ABI 'arm64-v8a', and processor 'aarch64'
-- Android: Selected unified Clang toolchain
-- The CXX compiler identification is Clang 17.0.2
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/me/Desktop/dev/android/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CXX standard: 17
-- C++ Requests CMake Options
-- =======================================================
--   CPR_GENERATE_COVERAGE: OFF
--   CPR_CURL_NOSIGNAL: OFF
--   CURL_VERBOSE_LOGGING: OFF
--   CPR_USE_SYSTEM_GTEST: OFF
--   CPR_USE_SYSTEM_CURL: OFF
--   CPR_ENABLE_CURL_HTTP_ONLY: ON
--   CPR_ENABLE_SSL: OFF
--   CPR_FORCE_OPENSSL_BACKEND: OFF
--   CPR_FORCE_WINSSL_BACKEND: OFF
--   CPR_FORCE_DARWINSSL_BACKEND: OFF
--   CPR_FORCE_MBEDTLS_BACKEND: OFF
--   CPR_ENABLE_LINTING: OFF
--   CPR_ENABLE_CPPCHECK: OFF
--   CPR_BUILD_TESTS: OFF
--   CPR_BUILD_TESTS_SSL: OFF
--   CPR_BUILD_TESTS_PROXY: OFF
--   CPR_SKIP_CA_BUNDLE_SEARCH: OFF
--   CPR_USE_BOOST_FILESYSTEM: OFF
--   CPR_DEBUG_SANITIZER_FLAG_THREAD: OFF
--   CPR_DEBUG_SANITIZER_FLAG_ADDR: OFF
--   CPR_DEBUG_SANITIZER_FLAG_LEAK: OFF
--   CPR_DEBUG_SANITIZER_FLAG_UB: OFF
--   CPR_DEBUG_SANITIZER_FLAG_ALL: OFF
-- =======================================================
-- Configuring built-in curl...
-- Using CMake version 3.27.4
-- ZLIB_HEADER_VERSION: 1.2.11
-- ZLIBNG_HEADER_VERSION: 2.0.6
-- The C compiler identification is Clang 17.0.2
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/me/Desktop/dev/android/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Arch detected: 'aarch64-none-linux-android21'
-- Basearch of 'aarch64-none-linux-android21' has been detected as: 'arm'
-- Performing Test FNO_LTO_AVAILABLE
-- Performing Test FNO_LTO_AVAILABLE - Success
-- Architecture supports unaligned reads
-- Architecture supports unaligned reads of > 4 bytes
-- Looking for sys/sdt.h
-- Looking for sys/sdt.h - not found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - done
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Performing Test HAVE_NO_INTERPOSITION
-- Performing Test HAVE_NO_INTERPOSITION - Success
-- Performing Test HAVE_ATTRIBUTE_VISIBILITY_HIDDEN
-- Performing Test HAVE_ATTRIBUTE_VISIBILITY_HIDDEN - Success
-- Performing Test HAVE_ATTRIBUTE_VISIBILITY_INTERNAL
-- Performing Test HAVE_ATTRIBUTE_VISIBILITY_INTERNAL - Success
-- Performing Test HAVE_BUILTIN_CTZ
-- Performing Test HAVE_BUILTIN_CTZ - Success
-- Performing Test HAVE_BUILTIN_CTZLL
-- Performing Test HAVE_BUILTIN_CTZLL - Success
-- Performing Test HAVE_PTRDIFF_T
-- Performing Test HAVE_PTRDIFF_T - Success
-- Architecture-specific source files: arch/arm/armfeature.c;arch/arm/crc32_acle.c;arch/arm/insert_string_acle.c;arch/arm/adler32_neon.c;arch/arm/chunkset_neon.c;arch/arm/slide_neon.c
-- The following features have been enabled:

 * CMAKE_BUILD_TYPE, Build type: Release (selected)
 * WITH_GZFILEOP, Compile with support for gzFile related functions
 * ZLIB_COMPAT, Compile with zlib compatible API
 * WITH_OPTIM, Build with optimisation
 * WITH_NEW_STRATEGIES, Use new strategies
 * WITH_UNALIGNED, Support unaligned reads on platforms that support it
 * WITH_ACLE, Build with ACLE
 * WITH_NEON, Build with NEON intrinsics
 * ACLE_CRC, Support ACLE optimized CRC hash generation, using "-march=armv8-a+crc"
 * NEON_ADLER32, Support NEON instructions in adler32, using "-march=armv8-a+simd"
 * NEON_SLIDEHASH, Support NEON instructions in slide_hash, using "-march=armv8-a+simd"

-- The following OPTIONAL packages have been found:

 * Git

-- The following features have been disabled:

 * ZLIB_ENABLE_TESTS, Build test binaries
 * ZLIB_DUAL_LINK, Dual link tests against system zlib
 * WITH_FUZZERS, Build test/fuzz
 * WITH_NATIVE_INSTRUCTIONS, Instruct the compiler to use the full instruction set on this host (gcc/clang -march=native)
 * WITH_MAINTAINER_WARNINGS, Build with project maintainer warnings
 * WITH_CODE_COVERAGE, Enable code coverage reporting
 * WITH_INFLATE_STRICT, Build with strict inflate distance checking
 * WITH_INFLATE_ALLOW_INVALID_DIST, Build with zero fill for inflate invalid distances
 * INSTALL_UTILS, Copy minigzip and minideflate during install

-- Disabled curl SSL
-- curl version=[8.4.0]
-- Picky compiler options: -Wextra -Wall -pedantic -Wbad-function-cast -Wconversion -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-long-long -Wno-multichar -Wpointer-arith -Wshadow -Wsign-compare -Wundef -Wunused -Wwrite-strings -Wcast-align -Wdeclaration-after-statement -Wempty-body -Wendif-labels -Wfloat-equal -Wignored-qualifiers -Wno-format-nonliteral -Wno-sign-conversion -Wno-system-headers -Wstrict-prototypes -Wtype-limits -Wvla -Wshift-sign-overflow -Wshorten-64-to-32 -Wdouble-promotion -Wenum-conversion -Wunused-const-variable -Wcomma -Wmissing-variable-declarations -Wassign-enum -Wextra-semi-stmt
-- Performing Test HAVE_SOCKADDR_IN6_SIN6_ADDR
-- Performing Test HAVE_SOCKADDR_IN6_SIN6_ADDR - Success
-- Performing Test HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
-- Performing Test HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID - Success
-- Found Perl: /usr/bin/perl (found version "5.36.0") 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Looking for connect in socket;-pthread
-- Looking for connect in socket;-pthread - not found
-- Looking for gethostname
-- Looking for gethostname - found
-- Found ZLIB: /home/me/Desktop/dev/android/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/21/libz.so (found version "1.2.13")  
-- Looking for idn2_lookup_ul in idn2;-pthread;ZLIB::ZLIB
-- Looking for idn2_lookup_ul in idn2;-pthread;ZLIB::ZLIB - not found
-- Could NOT find LibPSL (missing: LIBPSL_LIBRARY LIBPSL_INCLUDE_DIR) 
-- Could NOT find LibSSH2 (missing: LIBSSH2_LIBRARY LIBSSH2_INCLUDE_DIR) 
-- Performing Test USE_UNIX_SOCKETS
-- Performing Test USE_UNIX_SOCKETS - Success
-- Looking for include file inttypes.h
-- Looking for include file inttypes.h - found
-- Looking for include files inttypes.h, sys/filio.h
-- Looking for include files inttypes.h, sys/filio.h - not found
-- Looking for include files inttypes.h, sys/wait.h
-- Looking for include files inttypes.h, sys/wait.h - found
-- Looking for 3 include files inttypes.h, ..., sys/ioctl.h
-- Looking for 3 include files inttypes.h, ..., sys/ioctl.h - found
-- Looking for 4 include files inttypes.h, ..., sys/param.h
-- Looking for 4 include files inttypes.h, ..., sys/param.h - found
-- Looking for 5 include files inttypes.h, ..., sys/poll.h
-- Looking for 5 include files inttypes.h, ..., sys/poll.h - found
-- Looking for 6 include files inttypes.h, ..., sys/resource.h
-- Looking for 6 include files inttypes.h, ..., sys/resource.h - found
-- Looking for 7 include files inttypes.h, ..., sys/select.h
-- Looking for 7 include files inttypes.h, ..., sys/select.h - found
-- Looking for 8 include files inttypes.h, ..., sys/socket.h
-- Looking for 8 include files inttypes.h, ..., sys/socket.h - found
-- Looking for 9 include files inttypes.h, ..., sys/sockio.h
-- Looking for 9 include files inttypes.h, ..., sys/sockio.h - not found
-- Looking for 9 include files inttypes.h, ..., sys/stat.h
-- Looking for 9 include files inttypes.h, ..., sys/stat.h - found
-- Looking for 10 include files inttypes.h, ..., sys/time.h
-- Looking for 10 include files inttypes.h, ..., sys/time.h - found
-- Looking for 12 include files inttypes.h, ..., sys/un.h
-- Looking for 12 include files inttypes.h, ..., sys/un.h - found
-- Looking for 13 include files inttypes.h, ..., sys/utime.h
-- Looking for 13 include files inttypes.h, ..., sys/utime.h - not found
-- Looking for 13 include files inttypes.h, ..., sys/xattr.h
-- Looking for 13 include files inttypes.h, ..., sys/xattr.h - found
-- Looking for 14 include files inttypes.h, ..., arpa/inet.h
-- Looking for 14 include files inttypes.h, ..., arpa/inet.h - found
-- Looking for 15 include files inttypes.h, ..., fcntl.h
-- Looking for 15 include files inttypes.h, ..., fcntl.h - found
-- Looking for 16 include files inttypes.h, ..., idn2.h
-- Looking for 16 include files inttypes.h, ..., idn2.h - not found
-- Looking for 16 include files inttypes.h, ..., ifaddrs.h
-- Looking for 16 include files inttypes.h, ..., ifaddrs.h - found
-- Looking for 17 include files inttypes.h, ..., io.h
-- Looking for 17 include files inttypes.h, ..., io.h - not found
-- Looking for 17 include files inttypes.h, ..., libgen.h
-- Looking for 17 include files inttypes.h, ..., libgen.h - found
-- Looking for 18 include files inttypes.h, ..., locale.h
-- Looking for 18 include files inttypes.h, ..., locale.h - found
-- Looking for 19 include files inttypes.h, ..., net/if.h
-- Looking for 19 include files inttypes.h, ..., net/if.h - found
-- Looking for 20 include files inttypes.h, ..., netdb.h
-- Looking for 20 include files inttypes.h, ..., netdb.h - found
-- Looking for 21 include files inttypes.h, ..., netinet/in.h
-- Looking for 21 include files inttypes.h, ..., netinet/in.h - found
-- Looking for 22 include files inttypes.h, ..., netinet/tcp.h
-- Looking for 22 include files inttypes.h, ..., netinet/tcp.h - found
-- Looking for 23 include files inttypes.h, ..., netinet/udp.h
-- Looking for 23 include files inttypes.h, ..., netinet/udp.h - found
-- Looking for linux/tcp.h
-- Looking for linux/tcp.h - found
-- Looking for 24 include files inttypes.h, ..., poll.h
-- Looking for 24 include files inttypes.h, ..., poll.h - found
-- Looking for 25 include files inttypes.h, ..., pwd.h
-- Looking for 25 include files inttypes.h, ..., pwd.h - found
-- Looking for 26 include files inttypes.h, ..., stdatomic.h
-- Looking for 26 include files inttypes.h, ..., stdatomic.h - found
-- Looking for 27 include files inttypes.h, ..., stdbool.h
-- Looking for 27 include files inttypes.h, ..., stdbool.h - found
-- Looking for 29 include files inttypes.h, ..., strings.h
-- Looking for 29 include files inttypes.h, ..., strings.h - found
-- Looking for 30 include files inttypes.h, ..., stropts.h
-- Looking for 30 include files inttypes.h, ..., stropts.h - not found
-- Looking for 30 include files inttypes.h, ..., termio.h
-- Looking for 30 include files inttypes.h, ..., termio.h - found
-- Looking for 31 include files inttypes.h, ..., termios.h
-- Looking for 31 include files inttypes.h, ..., termios.h - found
-- Looking for 33 include files inttypes.h, ..., utime.h
-- Looking for 33 include files inttypes.h, ..., utime.h - found
-- Check size of size_t
-- Check size of size_t - done
-- Check size of ssize_t
-- Check size of ssize_t - done
-- Check size of long long
-- Check size of long long - done
-- Check size of long
-- Check size of long - done
-- Check size of int
-- Check size of int - done
-- Check size of __int64
-- Check size of __int64 - failed
-- Check size of time_t
-- Check size of time_t - done
-- Check size of suseconds_t
-- Check size of suseconds_t - done
-- Looking for fchmod
-- Looking for fchmod - found
-- Looking for fnmatch
-- Looking for fnmatch - found
-- Looking for basename
-- Looking for basename - found
-- Looking for socket
-- Looking for socket - found
-- Looking for sched_yield
-- Looking for sched_yield - found
-- Looking for socketpair
-- Looking for socketpair - found
-- Looking for recv
-- Looking for recv - found
-- Looking for send
-- Looking for send - found
-- Looking for sendmsg
-- Looking for sendmsg - found
-- Looking for select
-- Looking for select - found
-- Looking for strdup
-- Looking for strdup - found
-- Looking for strtok_r
-- Looking for strtok_r - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for stricmp
-- Looking for stricmp - not found
-- Looking for strcmpi
-- Looking for strcmpi - not found
-- Looking for memrchr
-- Looking for memrchr - found
-- Looking for alarm
-- Looking for alarm - found
-- Looking for arc4random
-- Looking for arc4random - found
-- Looking for fcntl
-- Looking for fcntl - found
-- Looking for getppid
-- Looking for getppid - found
-- Looking for utimes
-- Looking for utimes - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for closesocket
-- Looking for closesocket - not found
-- Looking for sigsetjmp
-- Looking for sigsetjmp - found
-- Looking for getpass_r
-- Looking for getpass_r - not found
-- Looking for getpwuid
-- Looking for getpwuid - found
-- Looking for getpwuid_r
-- Looking for getpwuid_r - found
-- Looking for geteuid
-- Looking for geteuid - found
-- Looking for utime
-- Looking for utime - found
-- Looking for gmtime_r
-- Looking for gmtime_r - found
-- Looking for gethostbyname_r
-- Looking for gethostbyname_r - found
-- Looking for signal
-- Looking for signal - found
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for strerror_r
-- Looking for strerror_r - found
-- Looking for siginterrupt
-- Looking for siginterrupt - found
-- Looking for getaddrinfo
-- Looking for getaddrinfo - found
-- Looking for getifaddrs
-- Looking for getifaddrs - not found
-- Looking for freeaddrinfo
-- Looking for freeaddrinfo - found
-- Looking for pipe
-- Looking for pipe - found
-- Looking for ftruncate
-- Looking for ftruncate - found
-- Looking for _fseeki64
-- Looking for _fseeki64 - not found
-- Looking for getpeername
-- Looking for getpeername - found
-- Looking for getsockname
-- Looking for getsockname - found
-- Looking for if_nametoindex
-- Looking for if_nametoindex - found
-- Looking for getrlimit
-- Looking for getrlimit - found
-- Looking for setlocale
-- Looking for setlocale - found
-- Looking for setmode
-- Looking for setmode - not found
-- Looking for setrlimit
-- Looking for setrlimit - found
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for mach_absolute_time
-- Looking for mach_absolute_time - not found
-- Looking for inet_ntop
-- Looking for inet_ntop - found
-- Looking for inet_pton
-- Looking for inet_pton - found
-- Looking for fsetxattr
-- Looking for fsetxattr - found
-- Performing Curl Test HAVE_FSETXATTR_5
-- Performing Curl Test HAVE_FSETXATTR_5 - Success
-- Performing Curl Test HAVE_FSETXATTR_6
-- Performing Curl Test HAVE_FSETXATTR_6 - Failed
-- Check size of sa_family_t
-- Check size of sa_family_t - done
-- Check size of ADDRESS_FAMILY
-- Check size of ADDRESS_FAMILY - failed
-- Looking for sigaction
-- Looking for sigaction - found
-- Performing Curl Test HAVE_FCNTL_O_NONBLOCK
-- Performing Curl Test HAVE_FCNTL_O_NONBLOCK - Success
-- Performing Curl Test HAVE_IOCTLSOCKET
-- Performing Curl Test HAVE_IOCTLSOCKET - Failed
-- Performing Curl Test HAVE_IOCTLSOCKET_CAMEL
-- Performing Curl Test HAVE_IOCTLSOCKET_CAMEL - Failed
-- Performing Curl Test HAVE_IOCTLSOCKET_CAMEL_FIONBIO
-- Performing Curl Test HAVE_IOCTLSOCKET_CAMEL_FIONBIO - Failed
-- Performing Curl Test HAVE_IOCTLSOCKET_FIONBIO
-- Performing Curl Test HAVE_IOCTLSOCKET_FIONBIO - Failed
-- Performing Curl Test HAVE_IOCTL_FIONBIO
-- Performing Curl Test HAVE_IOCTL_FIONBIO - Success
-- Performing Curl Test HAVE_IOCTL_SIOCGIFADDR
-- Performing Curl Test HAVE_IOCTL_SIOCGIFADDR - Success
-- Performing Curl Test HAVE_SETSOCKOPT_SO_NONBLOCK
-- Performing Curl Test HAVE_SETSOCKOPT_SO_NONBLOCK - Failed
-- Performing Curl Test HAVE_O_NONBLOCK
-- Performing Curl Test HAVE_O_NONBLOCK - Failed
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_3
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_3 - Failed
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_5
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_5 - Failed
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_6
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_6 - Success
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_3_REENTRANT
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_3_REENTRANT - Failed
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_5_REENTRANT
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_5_REENTRANT - Failed
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_6_REENTRANT
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_6_REENTRANT - Success
-- Performing Curl Test HAVE_IN_ADDR_T
-- Performing Curl Test HAVE_IN_ADDR_T - Success
-- Performing Curl Test HAVE_BOOL_T
-- Performing Curl Test HAVE_BOOL_T - Success
-- Performing Curl Test STDC_HEADERS
-- Performing Curl Test STDC_HEADERS - Success
-- Performing Curl Test HAVE_FILE_OFFSET_BITS
-- Performing Curl Test HAVE_FILE_OFFSET_BITS - Success
-- Performing Curl Test HAVE_VARIADIC_MACROS_C99
-- Performing Curl Test HAVE_VARIADIC_MACROS_C99 - Success
-- Performing Curl Test HAVE_VARIADIC_MACROS_GCC
-- Performing Curl Test HAVE_VARIADIC_MACROS_GCC - Success
-- Performing Curl Test HAVE_ATOMIC
-- Performing Curl Test HAVE_ATOMIC - Success
-- Check size of off_t
-- Check size of off_t - done
-- Check size of curl_off_t
-- Check size of curl_off_t - done
-- Check size of curl_socket_t
-- Check size of curl_socket_t - done
-- Performing Curl Test HAVE_GLIBC_STRERROR_R
-- Performing Curl Test HAVE_GLIBC_STRERROR_R - Failed
-- Performing Curl Test HAVE_POSIX_STRERROR_R
-- Performing Curl Test HAVE_POSIX_STRERROR_R - Success
-- Performing Curl Test HAVE_CLOCK_GETTIME_MONOTONIC
-- Performing Curl Test HAVE_CLOCK_GETTIME_MONOTONIC - Success
-- Performing Curl Test HAVE_BUILTIN_AVAILABLE
-- Performing Curl Test HAVE_BUILTIN_AVAILABLE - Success
-- Performing Test HAVE_MSG_NOSIGNAL
-- Performing Test HAVE_MSG_NOSIGNAL - Success
-- Performing Test HAVE_STRUCT_TIMEVAL
-- Performing Test HAVE_STRUCT_TIMEVAL - Success
-- Check size of struct sockaddr_storage
-- Check size of struct sockaddr_storage - done
-- Performing Test HAVE_H_ERRNO
-- Performing Test HAVE_H_ERRNO - Success
-- Performing Test HAVE_CLOCK_GETTIME_MONOTONIC_RAW
-- Performing Test HAVE_CLOCK_GETTIME_MONOTONIC_RAW - Success
-- Enabled features: IPv6 unixsockets libz AsynchDNS Largefile alt-svc HSTS threadsafe
-- Enabled protocols: HTTP
-- Enabled SSL backends: 
-- Configuring done (41.8s)
-- Generating done (0.1s)
-- Build files have been written to: /home/me/Desktop/dev/FactoryCapi/FactoryCapi_game/external_deps/cpr/build_android
[  0%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/adler32.c.o
[  0%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/chunkset.c.o
[  1%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/compare258.c.o
[  1%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/compress.c.o
[  1%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/crc32.c.o
[  1%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/crc32_comb.c.o
[  3%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/deflate.c.o
[  3%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/deflate_fast.c.o
[  3%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/deflate_medium.c.o
[  3%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/deflate_quick.c.o
[  5%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/deflate_slow.c.o
[  5%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/functable.c.o
[  5%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/infback.c.o
[  5%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/inffast.c.o
[  6%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/inflate.c.o
[  6%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/inftrees.c.o
[  6%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/insert_string.c.o
[  6%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/trees.c.o
[  8%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/uncompr.c.o
[  8%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/zutil.c.o
[  8%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/arch/arm/armfeature.c.o
[  8%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/arch/arm/crc32_acle.c.o
[ 10%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/arch/arm/insert_string_acle.c.o
[ 10%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/arch/arm/adler32_neon.c.o
[ 10%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/arch/arm/chunkset_neon.c.o
[ 10%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/arch/arm/slide_neon.c.o
[ 12%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/gzlib.c.o
[ 12%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/gzread.c.o
[ 12%] Building C object _deps/zlib-build/CMakeFiles/zlib.dir/gzwrite.c.o
[ 13%] Linking C shared library ../../lib/libz.so
ld.lld: error: version script assignment of 'local' to symbol 'inflate_fast' failed: symbol not defined
ld.lld: error: version script assignment of 'local' to symbol 'inflate_table' failed: symbol not defined
ld.lld: error: version script assignment of 'local' to symbol 'zcalloc' failed: symbol not defined
ld.lld: error: version script assignment of 'local' to symbol 'zcfree' failed: symbol not defined
ld.lld: error: version script assignment of 'local' to symbol 'gz_intmax' failed: symbol not defined
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [_deps/zlib-build/CMakeFiles/zlib.dir/build.make:545: lib/libz.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:169: _deps/zlib-build/CMakeFiles/zlib.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
-- Install configuration: "Release"
CMake Error at _deps/zlib-build/cmake_install.cmake:60 (file):
  file INSTALL cannot find
  "/home/me/Desktop/dev/FactoryCapi/FactoryCapi_game/external_deps/cpr/build_android/lib/libz.so":
  No such file or directory.
Call Stack (most recent call first):
  cmake_install.cmake:47 (include)

Example/How to Reproduce

repoUrl="https://github.com/libcpr/cpr.git"
gitTag="1.10.5"

git clone --depth 1 --branch $gitTag $repoUrl

cd cpr
mkdir -p build_android
cd build_android

cmake -S .. -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK="$ndkPath" -DCMAKE_INSTALL_PREFIX="$ndkPath/sources/third_party/cpr" -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DCMAKE_BUILD_TYPE=Release -DCPR_USE_SYSTEM_CURL=OFF -DCPR_ENABLE_SSL=OFF
cmake --build .
cmake --install .

I would like to add that if I remove -DCPR_ENABLE_SSL=OFF, I have the same error as #333 and I couldn't find a fix

Possible Fix

No response

Where did you get it from?

GitHub (1.10.5)

Additional Context/Your Environment

COM8 commented 11 months ago

Could you please try disabling zlib for curl via -DCURL_ZLIB=OFF?

Could you provide a bit if information on how to install NDK on Linux? Then I can have a look at it. But be aware, I do not have any android dev experience.

Nathan-M-code commented 11 months ago

With -DCURL_ZLIB=OFF it builded. I have to say that I had to manually do that : https://github.com/libcpr/cpr/commit/eb2d418f86d6907d81d67d900e7cd518b2d6e34b Or I got this error:

[100%] Linking CXX shared library ../lib/libcpr.so
ld.lld: error: unable to find library -lstdc++fs
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [cpr/CMakeFiles/cpr.dir/build.make:530: lib/libcpr.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:229: cpr/CMakeFiles/cpr.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

To use ndk, it is quite easy, manually download it at : https://developer.android.com/ndk/downloads And add -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK="$ndkPath" -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a as parametre for your cmake cmd. It will compile for android with the specified ndk

I didn't test the compiled libcpr yet, I'll let you know if everything is ok

COM8 commented 11 months ago

Ah, linking to stdc++fs was broken and is already fixed with the latest version on master. Could you please try master instead of the 1.10.5 release?

COM8 commented 11 months ago

Ref: https://github.com/libcpr/cpr/pull/987

Nathan-M-code commented 11 months ago

It worked without any error with ndk r25c (didn't try with r26b) ! Also I needed to set OFF SSL or I got

-- Detecting SSL backend...
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR) 
-- Could NOT find MbedTLS (missing: MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY) 
CMake Error at CMakeLists.txt:139 (message):
  No valid SSL backend found! Please install OpenSSL, Mbed TLS or disable SSL
  by setting CPR_ENABLE_SSL to OFF.

Same as #333 Why OpenSSL is not found the same way as if we build cpr without ndk ?

Nathan-M-code commented 10 months ago

With this command on master: cmake -S .. -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK="$ndkPath" -DCMAKE_INSTALL_PREFIX="$ndkPath/sources/third_party/cpr" -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DCMAKE_BUILD_TYPE=Release -DCPR_USE_SYSTEM_CURL=ON -DCURL_INCLUDE_DIR="/usr/include/x86_64-linux-gnu/curl" -DOPENSSL_INCLUDE_DIR="/usr/lib/ssl" ..

-- CXX standard: 17
-- C++ Requests CMake Options
-- =======================================================
--   CPR_GENERATE_COVERAGE: OFF
--   CPR_CURL_NOSIGNAL: OFF
--   CURL_VERBOSE_LOGGING: OFF
--   CPR_USE_SYSTEM_GTEST: OFF
--   CPR_USE_SYSTEM_CURL: ON
--   CPR_ENABLE_CURL_HTTP_ONLY: ON
--   CPR_ENABLE_SSL: ON
--   CPR_FORCE_OPENSSL_BACKEND: OFF
--   CPR_FORCE_WINSSL_BACKEND: OFF
--   CPR_FORCE_DARWINSSL_BACKEND: OFF
--   CPR_FORCE_MBEDTLS_BACKEND: OFF
--   CPR_ENABLE_LINTING: OFF
--   CPR_ENABLE_CPPCHECK: OFF
--   CPR_BUILD_TESTS: OFF
--   CPR_BUILD_TESTS_SSL: OFF
--   CPR_BUILD_TESTS_PROXY: OFF
--   CPR_SKIP_CA_BUNDLE_SEARCH: OFF
--   CPR_USE_BOOST_FILESYSTEM: OFF
--   CPR_DEBUG_SANITIZER_FLAG_THREAD: OFF
--   CPR_DEBUG_SANITIZER_FLAG_ADDR: OFF
--   CPR_DEBUG_SANITIZER_FLAG_LEAK: OFF
--   CPR_DEBUG_SANITIZER_FLAG_UB: OFF
--   CPR_DEBUG_SANITIZER_FLAG_ALL: OFF
-- =======================================================
-- Automatically detecting SSL backend.
-- Detecting SSL backend...
-- SSL auto detect: Using OpenSSL.
-- Curl  found on this system.
-- Configuring done (0.4s)
CMake Error at cpr/CMakeLists.txt:39 (target_link_libraries):
  Target "cpr" links to:

    OpenSSL::SSL

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

-- Generating done (0.0s)
CMake Generate step failed.  Build files cannot be regenerated correctly.
[  3%] Building CXX object cpr/CMakeFiles/cpr.dir/accept_encoding.cpp.o
In file included from /home/me/Desktop/dev/FactoryCapi/FactoryCapi_game/external_deps/cpr/cpr/accept_encoding.cpp:1:
/home/me/Desktop/dev/FactoryCapi/FactoryCapi_game/external_deps/cpr/include/cpr/accept_encoding.h:4:10: fatal error: 'curl/curlver.h' file not found
#include <curl/curlver.h>
         ^~~~~~~~~~~~~~~~
1 error generated.
gmake[2]: *** [cpr/CMakeFiles/cpr.dir/build.make:76: cpr/CMakeFiles/cpr.dir/accept_encoding.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:116: cpr/CMakeFiles/cpr.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
-- Install configuration: "Release"
CMake Error at cpr/cmake_install.cmake:52 (file):
  file INSTALL cannot find
  "/home/me/Desktop/dev/FactoryCapi/FactoryCapi_game/external_deps/cpr/build_android/lib/libcpr.so":
  No such file or directory.
Call Stack (most recent call first):
  cmake_install.cmake:47 (include)

With -DCPR_USE_SYSTEM_CURL=OFF I have got another error:

-- Looking for SSL_set0_wbio
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENSSL_SSL_LIBRARY
    linked by target "cmTC_faf7e" in directory /home/me/Desktop/dev/FactoryCapi/FactoryCapi_game/external_deps/cpr/build_android/CMakeFiles/CMakeScratch/TryCompile-9tboxN

CMake Error at /usr/share/cmake-3.27/Modules/CheckSymbolExists.cmake:140 (try_compile):
  Failed to generate test project build system.
Call Stack (most recent call first):
  /usr/share/cmake-3.27/Modules/CheckSymbolExists.cmake:66 (__CHECK_SYMBOL_EXISTS_IMPL)
  build_android/_deps/curl-src/CMakeLists.txt:646 (check_symbol_exists)
  build_android/_deps/curl-src/CMakeLists.txt:652 (openssl_check_symbol_exists)
COM8 commented 8 months ago

TLDR: OpenSSL Detection is not working correctly. You have to set it manually like we are doing it for macOS inside the CI: https://github.com/libcpr/cpr/blob/1ad1cd2daf138aefdcdb1c35d99608387d230ec1/.github/workflows/ci.yml#L256-L257

Deishelon commented 1 month ago

FYI, if you use vckpkg it has an older version (1.10.5#2), I've created an issue to update cpr to 1.11.0 which seems like fixing NDK linking issue. https://github.com/microsoft/vcpkg/issues/41876