Skip to content

1.10.x+ Install fails with CURL_PROGRESSFUNC_CONTINUE was not declared when CPR_USE_SYSTEM_CURL=ON is used #932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
motlaghreyhan opened this issue Jul 21, 2023 · 3 comments · Fixed by #1000

Comments

@motlaghreyhan
Copy link

motlaghreyhan commented Jul 21, 2023

Description

Installation fails at cmake build with the error listed below on 2 separate Rocky 8 machines.

I've tried to use 1.9.x but CPR_USE_SYSTEM_CURL doesn't appear to exist in that version, which provides the CMake files I need according to this offa/influxdb-cxx#200 (comment)

cmake --build .
Scanning dependencies of target cpr
[  3%] Building CXX object cpr/CMakeFiles/cpr.dir/accept_encoding.cpp.o
[  6%] Building CXX object cpr/CMakeFiles/cpr.dir/async.cpp.o
In file included from /opt/cpr/cpr/include/cpr/ssl_options.h:11,
                 from /opt/cpr/cpr/include/cpr/response.h:15,
                 from /opt/cpr/cpr/include/cpr/async_wrapper.h:8,
                 from /opt/cpr/cpr/include/cpr/async.h:4,
                 from /opt/cpr/cpr/cpr/async.cpp:1:
/opt/cpr/cpr/include/cpr/util.h: In function ‘int cpr::util::progressUserFunction(const T*, cpr::cpr_pf_arg_t, cpr::cpr_pf_arg_t, cpr::cpr_pf_arg_t, cpr::cpr_pf_arg_t)’:
/opt/cpr/cpr/include/cpr/util.h:26:36: error: ‘CURL_PROGRESSFUNC_CONTINUE’ was not declared in this scope
     static_assert(cancel_retval != CURL_PROGRESSFUNC_CONTINUE);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/cpr/cpr/include/cpr/util.h:26:36: note: suggested alternative: ‘CURLOPT_PROGRESSFUNCTION’
     static_assert(cancel_retval != CURL_PROGRESSFUNC_CONTINUE);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
                                    CURLOPT_PROGRESSFUNCTION
gmake[2]: *** [cpr/CMakeFiles/cpr.dir/build.make:96: cpr/CMakeFiles/cpr.dir/async.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:135: cpr/CMakeFiles/cpr.dir/all] Error 2
gmake: *** [Makefile:150: all] Error 2

Example/How to Reproduce

  1. git clone https://github.com/libcpr/cpr.git (also occurs with --branch=1.10.x as well)
  2. cd cpr && mkdir build && cd build
  3. cmake .. -DCPR_USE_SYSTEM_CURL=ON
  4. cmake --build .

Possible Fix

No response

Where did you get it from?

GitHub (branch e.g. master)

Additional Context/Your Environment

  • OS: Rocky
  • Version: 8.5
  • Branch: both master and 1.10.x
  • gcc 8.5.0, 12.2.0
  • cmake 3.20.2, 3.17.2
  • curl 7.61.1
@COM8
Copy link
Member

COM8 commented Jul 22, 2023

@motlaghreyhan Thanks for reporting!
As mentioned here, cpr 1.9.x supports CPR_USE_SYSTEM_CURL:

cpr_option(CPR_FORCE_USE_SYSTEM_CURL "If enabled we will use the curl lib already installed on this system." OFF)

It looks like CURL_PROGRESSFUNC_CONTINUE got removed in your version of libcurl since on the curl page it states: "Deprecated since 7.32.0."

I will look into this further ~at the end of the month after my vacation.

@motlaghreyhan
Copy link
Author

Thanks for the help! I was able to build 1.9.x on rhel8 with that flag no problem. influx-cxx seems to work with 1.9.x for me, so I'm in no rush for this issue at this point.

@COM8
Copy link
Member

COM8 commented Aug 3, 2023

Short update from my side. I can reproduce the issue inside a rocky 8 docker image the issue and this is something that affects libcurl releases around 7.61.0.

COM8 added a commit that referenced this issue Dec 26, 2023
Fixed CURL_PROGRESSFUNC_CONTINUE not always defined
@COM8 COM8 linked a pull request Dec 26, 2023 that will close this issue
COM8 added a commit that referenced this issue Dec 26, 2023
…ot_defined

Fixes #932 - `CURL_PROGRESSFUNC_CONTINUE` not always defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants