Skip to content

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

Description

@Shadowsith

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions