libcpr / cpr

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

error: ‘CURLOPT_SSL_ENABLE_NPN’ is deprecated: since 7.86.0. #971

Closed costagabbie closed 11 months ago

costagabbie commented 11 months ago

Description

Trying to build with cmake --build . --parallel the master branch on Debian 12(amd64) i get the following output In file included from /home/gcs/Git/cpr/include/cpr/curlholder.h:8, from /home/gcs/Git/cpr/include/cpr/cookies.h:4, from /home/gcs/Git/cpr/include/cpr/response.h:12, from /home/gcs/Git/cpr/include/cpr/async_wrapper.h:8, from /home/gcs/Git/cpr/include/cpr/session.h:12, from /home/gcs/Git/cpr/cpr/session.cpp:1: /home/gcs/Git/cpr/cpr/session.cpp: In member function ‘void cpr::Session::SetSslOptions(const cpr::SslOptions&)’: /home/gcs/Git/cpr/cpr/session.cpp:516:37: error: ‘CURLOPT_SSL_ENABLE_NPN’ is deprecated: since 7.86.0. Has no function [-Werror=deprecated-declarations] 516 | curl_easy_setopt(curl_->handle, CURLOPT_SSL_ENABLE_NPN, options.enable_npn ? ON : OFF); | ^~~~~~~~~~~~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/curl/curl.h:1901:3: note: declared here 1901 | CURLOPTDEPRECATED(CURLOPT_SSL_ENABLE_NPN, CURLOPTTYPE_LONG, 225, | ^~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors Didn't seem to have any other issue opened with the same deprecation error

Example/How to Reproduce

On a Debian 12(amd64) system

  1. git clone https://github.com/libcpr/cpr.git
  2. cd cpr && mkdir build && cd build
  3. cmake .. -DCPR_USE_SYSTEM_CURL=ON
  4. cmake --build . --parallel
  5. Error(that is a warning) described in the description happens

Possible Fix

No response

Where did you get it from?

GitHub (branch e.g. master)

Additional Context/Your Environment

COM8 commented 11 months ago

Thanks for reporting @costagabbie!

Fixed in #972. Can you confirm?

costagabbie commented 11 months ago

Thanks for reporting @costagabbie!

Fixed in #972. Can you confirm?

Seems like it is fixed on #972