-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
get_info(CURLINFO_COOKIELIST) not referenced #43
Comments
@tucanus Hi and thank you for using curlcpp! auto pippo = easy.get_info(CURLINFO_COOKIELIST); with this: auto pippo = easy.get_info<vector<string>>(CURLINFO_COOKIELIST); get_info is a template method in which you have to specify the type. Let me know! |
Sorry, it is true, my mistake. I suspect code of get_info being incorrect ( // Putting the namespace here will avoid the "specialization in different namespace" error.
namespace curl {
template<> std::unique_ptr<std::vector<std::string>> curl_easy::get_info(const CURLINFO info) const {
struct curl_slist *ptr = nullptr;
const CURLcode code = curl_easy_getinfo(this->curl,info,&ptr);
if (code != CURLE_OK) {
curl_slist_free_all(ptr);
throw curl_easy_exception(code,__FUNCTION__);
}
std::vector<std::string> infos;
struct curl_slist *list = ptr;
while (list != nullptr) {
infos.push_back(std::string(list->data));
list = list->next;
}
curl_slist_free_all(ptr);
return std::unique_ptr<std::vector<std::string>>{new std::vector<std::string>(infos)};
}
} Thank you for your support and your time. |
@tucanus Yeah, right! Now it works also on my environment! Thank you! If everything works, you can close the issue. For anything else, let me know! I will update the repo as soon as possible. |
Before all, thank you for your work, very useful.
I built your library on Ubuntu 14.04, using libcurl 7.35 (after removing line 276 of curl_easy.h, because it caused compiling error).
Then I moved header files in /usr/include/curlcpp, libcurlcpp.a in /usr/lib.
Source code of the simple test program is
I compiled succesfully (g++ -std=c++0x -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cpp"), but linking (g++ -o "testCurlCpp" ./main.o -lcurl -lcurlcpp) fails saying
main.cpp:15: undefined reference to "curl::curl_easy::get_info(CURLINFO) const"
.Removing line 15 all works fine.
Thank you.
The text was updated successfully, but these errors were encountered: