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

README: update 'libcurl on Windows' section #87

Open
bkircher opened this issue Jan 3, 2018 · 7 comments
Open

README: update 'libcurl on Windows' section #87

bkircher opened this issue Jan 3, 2018 · 7 comments

Comments

@bkircher
Copy link
Collaborator

bkircher commented Jan 3, 2018

One can easily build libcurl on Windows from source (with https://gitlab.com/benjamin.kircher/curl-winbuild for example) and I believe a recent Windows 10 comes now with curl bundled (no idea about libcurl, though).

Investigate and update README.md accordingly.

@bkircher
Copy link
Collaborator Author

bkircher commented Jan 3, 2018

See: curl on Windows.

The confusedbycode.com/curl hint should be removed from the README section, IMO.

@zamazan4ik
Copy link

IMO we can just create normal package with Conan and drop support for so strange way to deliver Curl on Windows

@bkircher
Copy link
Collaborator Author

bkircher commented May 3, 2019

Excellent idea! Definitely willing to merge (unfortunately I have no Windows environment for testing anymore. But I guess we find somebody who has).

@zamazan4ik
Copy link

Ok. Locally I just wrote conanfile.py. Quality is a little bit prototypish :) I use libcurl from from Conan. Can I also switch to rapidxml from Conan instead of built-in one?

Another annoying issue - there are no options in current version of CMakeLists to disable building examples and/or tests.

@bkircher
Copy link
Collaborator Author

bkircher commented May 3, 2019

Can I also switch to rapidxml from Conan instead of built-in one?

That won't work I guess. The build in one is heavily patched to support (to some extend) XML namespaces.

Another annoying issue - there are no options in current version of CMakeLists to disable building examples and/or tests.

Good point. I created a ticket #147 for this. (And as always, PRs always welcome 😄 )

@zamazan4ik
Copy link

zamazan4ik commented May 4, 2019

Btw, which libcurl version is required? Cannot find libcurl which will compile successfully with ews-cpp on Fedora 30 (trying different versions with Conan). Every time get smth like this:

In file included from /home/zamazan4ik/OpenSource/ews_cpp_poc/main.cpp:1:
/home/zamazan4ik/OpenSource/ews_cpp_poc/include/ews/ews.hpp:8235:74: error: too many arguments provided to function-like macro invocation
            auto retcode = curl_easy_setopt(handle_.get(), option, arg1, arg2);
                                                                         ^
/home/zamazan4ik/.conan/data/libcurl/7.50.3/bincrafters/stable/package/e8a4f36e9466788262927d466c3366a18c0ab134/include/curl/curl.h:2443:9: note: macro
      'curl_easy_setopt' defined here
#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
        ^
In file included from /home/zamazan4ik/OpenSource/ews_cpp_poc/main.cpp:1:
/home/zamazan4ik/OpenSource/ews_cpp_poc/include/ews/ews.hpp:8236:13: error: statement requires expression of integer type
      ('CURLcode (*)(void *, CURLoption, ...)' invalid)
            switch (retcode)
            ^       ~~~~~~~
/home/zamazan4ik/OpenSource/ews_cpp_poc/include/ews/ews.hpp:8243:23: error: no matching function for call to 'make_curl_error'
                throw make_curl_error("curl_easy_setopt: unsupported option",
                      ^~~~~~~~~~~~~~~
/home/zamazan4ik/OpenSource/ews_cpp_poc/include/ews/ews.hpp:7680:23: note: candidate function not viable: no known conversion from
      'CURLcode (*)(void *, CURLoption, ...)' to 'CURLcode' for 2nd argument
    inline curl_error make_curl_error(const std::string& msg, CURLcode rescode)
                      ^
/home/zamazan4ik/OpenSource/ews_cpp_poc/include/ews/ews.hpp:8249:23: error: no matching function for call to 'make_curl_error'
                throw make_curl_error("curl_easy_setopt: failed setting option",
                      ^~~~~~~~~~~~~~~
/home/zamazan4ik/OpenSource/ews_cpp_poc/include/ews/ews.hpp:7680:23: note: candidate function not viable: no known conversion from
      'CURLcode (*)(void *, CURLoption, ...)' to 'CURLcode' for 2nd argument
    inline curl_error make_curl_error(const std::string& msg, CURLcode rescode)

@bkircher
Copy link
Collaborator Author

bkircher commented May 5, 2019

Btw, which libcurl version is required?

7.29 is required. Your version is absolutely fine.

The issue you have is that you don't have the feature test macros enabled for you build.

In this case the error might go away if you manually define

#define EWS_HAS_VARIADIC_TEMPLATES 1

before including ews.hpp header.

Take a look at the feature test macros in CMakeLists.txt to see all tests. Note that you don't need to use CMake to build your project. You can record the results of the CMake tests and then manually define the macros for your compiler/standard library in an intermediate header file.

Something like

#ifndef _WIN32
#define EWS_HAS_VARIADIC_TEMPLATES 1
#endif
#ifndef NDEBUG
#define EWS_DISABLE_TLS_CERT_VERIFICATION 1
#endif

// and so on… now include ews.hpp

#include "ews/ews.hpp"
#include "ews/ews_version.hpp"

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

No branches or pull requests

2 participants