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

[v1.10.2] g++ compile error: curlholder.h:31:12: error: using typedef-name ‘curl_mime’ after ‘struct’ #892

Closed
stayknight opened this issue Mar 30, 2023 · 1 comment · Fixed by #893

Comments

@stayknight
Copy link

Description

When I integrate cpr into my project, the compiler gives this error:

/somerootpath/cpr/include/cpr/curlholder.h:31:12: error: using typedef-name ‘curl_mime’ after ‘struct’
   31 |     struct curl_mime* multipart{nullptr};
      |            ^~~~~~~~~
In file included from /somerootpath/cpr/include/cpr/curlholder.h:8,
                 from /somerootpath/cpr/include/cpr/cookies.h:4,
                 from /somerootpath/cpr/include/cpr/util.h:9,
                 from /somerootpath/cpr/cpr/auth.cpp:2:
/usr/include/arm-linux-gnueabihf/curl/curl.h:2099:33: note: ‘curl_mime’ has a previous declaration here
 2099 | typedef struct curl_mime_s      curl_mime;      /* Mime context. */
      |                                 ^~~~~~~~~

Example/How to Reproduce

set(ENV{CPR_USE_SYSTEM_CURL} "ON")
FetchContent_Declare(cpr
  URL https://github.com/libcpr/cpr/archive/refs/tags/1.10.2.tar.gz
  DOWNLOAD_NAME cpr-v1.10.2.tar.xz
)
FetchContent_MakeAvailable(cpr)

Possible Fix

I don't know.

Where did you get it from?

GitHub (branch e.g. master)

Additional Context/Your Environment

  • OS: ubuntu 20.04 LTS
  • Compiler: g++ 9.4.0
  • Version: 1.10.2
guylevy84 added a commit to guylevy84/cpr that referenced this issue Mar 30, 2023
we already have previous declaration of ‘curl_mime’ in curl.h: typedef struct curl_mime_s curl_mime;
guylevy84 added a commit to guylevy84/cpr that referenced this issue Mar 30, 2023
we already have previous declaration of ‘curl_mime’ in curl.h: typedef struct curl_mime_s curl_mime;
guylevy84 added a commit to guylevy84/cpr that referenced this issue Mar 30, 2023
fix error: using typedef-name ‘curl_mime’ after ‘struct’ (libcpr#892)
guylevy84 added a commit to guylevy84/cpr that referenced this issue Mar 30, 2023
we already have previous declaration of ‘curl_mime’ in curl.h: typedef struct curl_mime_s curl_mime;
@COM8 COM8 closed this as completed in #893 Mar 31, 2023
COM8 added a commit that referenced this issue Mar 31, 2023
fix error: using typedef-name ‘curl_mime’ after ‘struct’ (#892)
COM8 added a commit that referenced this issue Mar 31, 2023
fix error: using typedef-name ‘curl_mime’ after ‘struct’ (#892)
COM8 added a commit that referenced this issue Mar 31, 2023
fix error: using typedef-name ‘curl_mime’ after ‘struct’ (#892)
@COM8
Copy link
Member

COM8 commented Mar 31, 2023

Thanks for reporting. #893 fixes it. A new release will follow probably this weekend.

RuleOfThrees pushed a commit to RuleOfThrees/cpr that referenced this issue Apr 6, 2023
we already have previous declaration of ‘curl_mime’ in curl.h: typedef struct curl_mime_s curl_mime;
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