Comments (7)
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.
from cpr.
With -DCURL_ZLIB=OFF
it builded.
I have to say that I had to manually do that : eb2d418
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
from cpr.
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?
from cpr.
Ref: #987
from cpr.
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 ?
from cpr.
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)
from cpr.
TLDR: OpenSSL Detection is not working correctly. You have to set it manually like we are doing it for macOS inside the CI:
Lines 256 to 257 in 1ad1cd2
from cpr.
Related Issues (20)
- SSL certificate pinning HOT 3
- Question: Is `WriteCallback` asynchronous? HOT 1
- cpr::Buffer data lifetime question HOT 4
- constexpr methods for some string-like types HOT 1
- Add support for identifying whether a Session is currently busy or not HOT 1
- zlib ignores --prefix/CMAKE_INSTALL_PREFIX when using cpr as external dependency HOT 2
- Link error when creating a cpr::Header, segment fault when making cpr::Get request HOT 1
- Question: Does cpr support ftp? HOT 1
- Confused on something HOT 3
- Call of overloaded ‘SetOption(std::__cxx11::basic_string<char>)’ is ambiguous HOT 1
- 13.2.0 gcc compiler, vcpkg and cpr: compilation error. HOT 7
- cpr::ThreadPool high CPU usage when Paused HOT 4
- Interceptors are single-shot
- async callback with highest performance? HOT 2
- Thread Pool Deadlock While Task Wait HOT 1
- Possible race condition in singleton class GetInstance() function HOT 1
- cpr use system default curl? HOT 8
- parallelized http get/post request with trying best to reuse connections? HOT 1
- Multiple Invocations of cpr::MultiPerform Segfault
- cpr/cpr.h: No such file or directory HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpr.