[rrd-users] Code works on linux but not on windows

tariksimao moratosimao at gmail.com
Wed Mar 7 20:08:34 CET 2012


Hi, I'm Tárik

I'm embedding the rrdtool code on my solution and I'm experiencing some hard
time to make the code work on windows. On the other hand I can make
everything work on linux. For example, I have the following function:

CreateDataBase(std::string db_name, int update_rate, time_t start_date){
            std::stringstream ss0;
           
ss0<<"DS:"<<_ret->_variable_name<<":ABSOLUTE:"<<4*update_rate<<":U:U";
            std::string s0 = ss0.str();
            char* t0 = new char[s0.size()];
            std::strcpy(t0,s0.c_str());
            _ret->_creation_params.push_back(t0);

            std::stringstream ss1;
           
ss1<<"RRA:AVERAGE:0.9:"<<update_rate&lt;&lt;&quot;:&quot;&lt;&lt;180*24*60*60/update_rate;
            std::string s1 = ss1.str();
            char* t1 = new char[s1.size()];
            std::strcpy(t1,s1.c_str());
            _ret->_creation_params.push_back(t1);

            std::stringstream ss2;
            ss2<<"RRA:AVERAGE:0.9:60:259200";
            std::string s2 = ss2.str();
            char* t2 = new char[s2.size()];
            std::strcpy(t2,s2.c_str());
            _ret->_creation_params.push_back(t2);

            std::stringstream ss3;
            ss3<<"RRA:AVERAGE:0.9:3600:4320";
            std::string s3 = ss3.str();
            char* t3 = new char[s3.size()];
            std::strcpy(t3,s3.c_str());
            _ret->_creation_params.push_back(t3);

            std::stringstream ss4;
            ss4<<"RRA:AVERAGE:0.9:86400:180";
            std::string s4 = ss4.str();
            char* t4 = new char[s4.size()];
            std::strcpy(t4,s4.c_str());
            _ret->_creation_params.push_back(t4);
					
            char** argv = &(_ret->_creation_params.front());
	    int argc = _ret->_creation_params.size();
            int rrd_error = rrd_create_r(_ret->_db_name.c_str(),(unsigned
long) update_rate, start_date, argc,(const char**) argv);
}

And I'm having the "you must define at least one Round Robin Archive"
rrdtool error. What's going on??

Note that this code runs alright on linux but not on windows. Also, I've
downloaded the rrdtool-1.4.7 and compile successfully on both platforms.

Thanks
Regards
Tárik 

--
View this message in context: http://rrd-mailinglists.937164.n2.nabble.com/Code-works-on-linux-but-not-on-windows-tp7352811p7352811.html
Sent from the RRDtool Users Mailinglist mailing list archive at Nabble.com.



More information about the rrd-users mailing list