Hello!
I have written a function to use with WriteFunction and WriteData, but
it doesn't want to compile.
Here is the structure:
******
struct SMS
{
cURLpp::Easy handle;
string prefix,body;
char temp[500];
SMS();
~SMS();
void loguj(string siec,bool czyssl);
void wiadomosc(string siec);
void wyloguj(string siec);
private:
void post(string adres,string dane);
void get(string adres);
string zamien(char* tmp);
};
*******
and function:
*******
size_t elem(void *buffer, size_t size, size_t nmemb, SMS *es)
{
char *buf;
buf = (char *)buffer;
int bodyLen = nmemb * size;
es->body.reserve(bodyLen);
for(int i = 0; i < bodyLen; i++)
es->body += buf[i];
return bodyLen;
}
*******
and constructor for SMS:
*******
SMS::SMS()
{
initscr();
handle.setOpt(cURLpp::Options::SslVerifyPeer(false));
handle.setOpt(cURLpp::Options::SslVerifyHost(false));
handle.setOpt(cURLpp::Options::AutoReferer(true));
handle.setOpt(cURLpp::Options::FollowLocation(true));
handle.setOpt(cURLpp::Options::MaxRedirs(10));
handle.setOpt(cURLpp::Options::CookieFile(""));
handle.setOpt(cURLpp::Options::WriteData(this));
handle.setOpt(cURLpp::Options::WriteFunction((void*)elem));
}
*******
and compilator's error:
*******
mod3.cpp: In constructor `SMS::SMS()':
mod3.cpp:37: error: no matching function for call to `
cURLpp::OptionTrait<FILE*, CURLOPT_FILE>::OptionTrait(SMS* const)'
/usr/local/include/curlpp/Option.hpp:132: error: candidates are:
cURLpp::OptionTrait<FILE*, CURLOPT_FILE>::OptionTrait(const
cURLpp::OptionTrait<FILE*, CURLOPT_FILE>&)
/usr/local/include/curlpp/Option.inl:123: error:
cURLpp::OptionTrait<OptionType, option>::OptionTrait() [with OptionType =
FILE*, CURLoption option = CURLOPT_FILE]
/usr/local/include/curlpp/Option.inl:118: error:
cURLpp::OptionTrait<OptionType, option>::OptionTrait(typename
cURLpp::Option<OptionType>::ParamType) [with OptionType = FILE*, CURLoption
option = CURLOPT_FILE]
*******
I don't know what is wrong. Please help me.
Greetings,
Jacek Jablonski
_______________________________________________
cURLpp mailing list
cURLpp_at_rrette.com
http://www.rrette.com/mailman/listinfo/curlpp
Received on 2006-01-22