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

unable to compile the post example #20

Closed
carlzoo opened this issue Dec 5, 2014 · 2 comments
Closed

unable to compile the post example #20

carlzoo opened this issue Dec 5, 2014 · 2 comments

Comments

@carlzoo
Copy link

carlzoo commented Dec 5, 2014

Hello,
I tried to compile the example with the http post login and I get this message.

g++ -std=c++11 postexample.cpp -L curlcpp/build/src/ -I curlcpp/include/ -lcurlcpp -lcurl -o
postexample :(
In file included from curlcpp/include/curl_easy.h:34:0,
from postexample.cpp:1:
curlcpp/include/curl_pair.h: In instantiation of ‘curl::curl_pair<T, std::basic_string >::curl_pair(T, const string&) [with T = CURLformoption; std::string = std::basic_string]’:
postexample.cpp:12:70: required from here
curlcpp/include/curl_pair.h:85:72: warning: comparison between ‘const enum CURLformoption’ and ‘enum CURLoption’ [-Wenum-compare]
curl_pair(const T option, const string &value) : option(option == CURLOPT_POSTFIELDS ? CURLOPT_COPYPOSTFIELDS : option), value(value) {};
^
curlcpp/include/curl_pair.h:85:94: warning: enumeral mismatch in conditional expression: ‘CURLoption’ vs ‘CURLformoption’ [-Wenum-compare]
curl_pair(const T option, const string &value) : option(option == CURLOPT_POSTFIELDS ? CURLOPT_COPYPOSTFIELDS : option), value(value) {};
^
In file included from curlcpp/include/curl_easy.h:34:0,
from postexample.cpp:1:
curlcpp/include/curl_pair.h:85:141: error: invalid conversion from ‘int’ to ‘CURLformoption’ [-fpermissive]
curl_pair(const T option, const string &value) : option(option == CURLOPT_POSTFIELDS ? CURLOPT_COPYPOSTFIELDS : option), value(value) {};

@JosephP91
Copy link
Owner

Hi @carlzoo ,
I fixed the error with the last commit. As the error message you posted says, there was a comparison between two different types (CURLformoption and CURLoption). With the last commit I should had fixed the problem. Let me know!

@carlzoo
Copy link
Author

carlzoo commented Dec 13, 2014

it compiles now thanks

@carlzoo carlzoo closed this as completed Dec 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants