libcpr / cpr

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

Could NOT find CURL (missing: HTTP) (found version "7.80.0") #907

Closed ronytigo closed 1 year ago

ronytigo commented 1 year ago

Description

I followed the instructions to install cpr. when I run cmake .. -DCPR_USE_SYSTEM_CURL=ON I get this error:

-- Could NOT find CURL (missing: HTTP) (found version "7.80.0")
-- Could NOT find CURL (missing: HTTP) (found version "7.80.0")
CMake Error at CMakeLists.txt:193 (message):
  Curl not found on this system.  To use the built-in version set
  CPR_USE_SYSTEM_CURL to OFF.

Example/How to Reproduce

$ git clone https://github.com/libcpr/cpr.git $ cd cpr && mkdir build && cd build $ cmake .. -DCPR_USE_SYSTEM_CURL=ON

Possible Fix

No response

Where did you get it from?

GitHub (branch e.g. master)

Additional Context/Your Environment

Distributor ID: Ubuntu Description: Ubuntu 20.04.4 LTS Release: 20.04 Codename: focal

COM8 commented 1 year ago

Try sudo apt install libcurl-dev since if you set CPR_USE_SYSTEM_CURL to ON it requires the curl header files on your system.

ronytigo commented 1 year ago

This one is not working but I did run sudo apt install libcurlpp-dev and it didn't help.

COM8 commented 1 year ago

On a clean ubuntu:20.04 container for me all works as expected. You are installing the cpp bindings for libcurl. But we need the c bindings.

Here is how I did it:

git clone https://github.com/libcpr/cpr.git
cd cpr
mkdir build && cd build
apt install libssl-dev gcc g++ cmake git libcurl4-openssl-dev
cmake .. -DCPR_USE_SYSTEM_CURL=ON
cmake --build . --parallel
cmake --build . --target install