Skip to content
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

Cmake build failed #960

Closed
Seazer-x opened this issue Sep 11, 2023 · 3 comments · Fixed by #985
Closed

Cmake build failed #960

Seazer-x opened this issue Sep 11, 2023 · 3 comments · Fixed by #985

Comments

@Seazer-x
Copy link

Description

image

Example/How to Reproduce

  1. i had install libssl-dev and libcurl4-openssl-dev
  2. run cmake --build .
  3. raised error :/root/xxx/cpr/cpr/session.cpp:160:58: error: ‘CURLSSLOPT_NATIVE_CA’ was not declared in this scope
    160 | curl_easy_setopt(curl_->handle, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA);

Possible Fix

No response

Where did you get it from?

GitHub (branch e.g. master)

Additional Context/Your Environment

  • OS: Ubuntu
  • Version: 20.04.LTS arm64
@KingKili
Copy link
Member

Have also executed the configuration step (cmake ..)?
If this does not help please share a full build log (including configuration step)

@Seazer-x
Copy link
Author

following setp by this:
find_package
cmakeoutput log:
CMakeOutput.log

@COM8
Copy link
Member

COM8 commented Sep 12, 2023

You are probably trying to compile with -DCPR_USE_SYSTEM_CURL=ON right?
If so, your system libcurl version is too old. Ubuntu20.04 provides libcurl 7.68.0 but CURLSSLOPT_NATIVE_CA requires at least 7.71.0.

Please use the build in version of curl via cmake .. -DCPR_USE_SYSTEM_CURL=OFF

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.

3 participants