Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Compile issue on openSuse #174

Open
frankgraz opened this issue Nov 1, 2024 · 1 comment
Open

Compile issue on openSuse #174

frankgraz opened this issue Nov 1, 2024 · 1 comment

Comments

@frankgraz
Copy link

When building this error pops up:

Options.hpp:281:74: error: invalid conversion from ‘int’ to ‘CURLoption’ [-fpermissive]
281 | typedef curlpp::OptionTrait<curl_closepolicy, CURLOPT_CLOSEPOLICY> ClosePolicy;
| ^
| |
| int

@gvanem
Copy link

gvanem commented Nov 11, 2024

I get the same error on Windows/MSVC/clang-cl too:

../../include\curlpp/Options.hpp(311,48): error: value of type 'int' is not implicitly convertible to 'CURLoption'
  311 |         typedef curlpp::OptionTrait<curl_closepolicy, CURLOPT_CLOSEPOLICY> ClosePolicy;
      |                                                       ^~~~~~~~~~~~~~~~~~~
../../../include\curl/curl.h(719,29): note: expanded from macro 'CURLOPT_CLOSEPOLICY'
  719 | #define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72
      |                             ^~~~~~~~~~~~~~~~~~
../../../include\curl/curl.h(720,28): note: expanded from macro 'CURLOPT_OBSOLETE72'
  720 | #define CURLOPT_OBSOLETE72 9999
      |                            ^~~~

Which I fixed by:

--- a/include/curlpp/Options.hpp 2024-06-01 06:49:19
+++ b/include/curlpp/Options.hpp 2024-11-11 11:20:30
@@ -308,7 +308,9 @@
        typedef curlpp::OptionTrait<long, CURLOPT_LOW_SPEED_LIMIT> LowSpeedLimit;
        typedef curlpp::OptionTrait<long, CURLOPT_LOW_SPEED_TIME> LowSpeedTime;
        typedef curlpp::OptionTrait<long, CURLOPT_MAXCONNECTS> MaxConnects;
+#if LIBCURL_VERSION_NUM < 0x071001
        typedef curlpp::OptionTrait<curl_closepolicy, CURLOPT_CLOSEPOLICY> ClosePolicy;
+#endif
        typedef curlpp::OptionTrait<bool, CURLOPT_FRESH_CONNECT> FreshConnect;
        typedef curlpp::OptionTrait<bool, CURLOPT_FORBID_REUSE> ForbidReuse;
        typedef curlpp::OptionTrait<long, CURLOPT_CONNECTTIMEOUT> ConnectTimeout;

I've no idea if it's correct.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants