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

error: macro "curl_easy_setopt" passed 4 arguments, but takes just 3 #206

Open
Shadowsith opened this issue Sep 22, 2023 · 2 comments
Open
Labels
Milestone

Comments

@Shadowsith
Copy link

If I tried to compile some of the examples like the main example in the project README I got following error:

/usr/local/ews/ews.hpp:8465:78: error: macro "curl_easy_setopt" passed 4 arguments, but takes just 3
 8465 |             auto retcode = curl_easy_setopt(handle_.get(), option, arg1, arg2);
      |                                                                              ^
In file included from /usr/local/ews/ews.hpp:57,
                 from test.cpp:1:
/usr/include/x86_64-linux-gnu/curl/curl.h:3097: note: macro "curl_easy_setopt" defined here
 3097 | #define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
      |
In file included from test.cpp:1:
/usr/local/ews/ews.hpp: In member function ‘void ews::internal::http_request::set_option(CURLoption, T1, T2)’:
/usr/local/ews/ews.hpp:8474:39: error: cannot convert ‘CURLcode (*)(void*, CURLoption, ...)’ to ‘CURLcode’
 8474 |                                       retcode);
      |                                       ^~~~~~~
      |                                       |
      |                                       CURLcode (*)(void*, CURLoption, ...)
/usr/local/ews/ews.hpp:7740:72: note:   initializing argument 2 of ‘ews::curl_error ews::internal::make_curl_error(const string&, CURLcode, const string&)’
 7740 |     inline curl_error make_curl_error(const std::string& msg, CURLcode rescode,
      |                                                               ~~~~~~~~~^~~~~~~
/usr/local/ews/ews.hpp:8480:39: error: cannot convert ‘CURLcode (*)(void*, CURLoption, ...)’ to ‘CURLcode’
 8480 |                                       retcode);
      |                                       ^~~~~~~
      |                                       |
      |                                       CURLcode (*)(void*, CURLoption, ...)
/usr/local/ews/ews.hpp:7740:72: note:   initializing argument 2 of ‘ews::curl_error ews::internal::make_curl_error(const string&, CURLcode, const string&)’
 7740 |     inline curl_error make_curl_error(const std::string& msg, CURLcode rescode,
      |                                                               ~~~~~~~~~^~~~~~~

OS:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy

curl:

$ curl --version
curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.12
Release-Date: 2022-01-05
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd

Which libcurl version has been used as base for the project?

@Shadowsith
Copy link
Author

Shadowsith commented Sep 25, 2023

I was now able to fix the error myself. I commented out the template method void set_option(CURLoption option, T1 arg1, T2 arg2) which includes curl_easy_setopt with 4 arugments in ews.hpp and since then I can compile it without errors and it works as described.

@idolum
Copy link
Member

idolum commented Sep 26, 2023

@Shadowsith Thank your for pointing this issue out! But it should compile without changing the code. I reopend the issue and will take a look at it.

@idolum idolum reopened this Sep 26, 2023
@idolum idolum added the bug label Sep 26, 2023
@idolum idolum added this to the 0.12 milestone Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants