October 16, 200520 yr Hi ChrisCompiling timemanager I get some overloading errors. Any idea ? I add the log.thanksHarald
October 16, 200520 yr Harald,The problem is the types of the arguments in these function calls. tzDelta.dMinutes = (int)(fmod (offset, 1.0) * 60);In this case, 'offset' is a float and the constant 1.0 is a double by default. There are versions of fmod() that take float,float and double,double and long double,long double, but the compiler doesn't want to guess which version to convert the double,float arguments to. The problem with the floor() calls is that the arguments are integers and need to be explicitly cast as floats.You just need to make the argument types more explicit. Replace the lines in TimeManager.cpp with the following and it should fix the problems:171: tzDelta.dMinutes = (int)(fmod (offset, 1.0f) * 60);459: float n1 = (float)(floor(float(275 * date.month / 9)));460: float n2 = (float)(floor(float((date.month + 9) / 12)));461: float n3 = (float)((1 + floor(float(date.year - 4 * floor(date.year / 4) + 2) / 3))));566: rise.minute = (int)(fmod(utRise, 1.0f) * 60);569: set.minute = (int)(fmod(utSet, 1.0f) * 60);Chris WallaceOttawa, Canada
October 20, 200520 yr Author Hi ChrisIt worked, I had only to change line 461 fromfloat n3 = (float)((1 + floor(float(date.year - 4 * floor(date.year / 4) + 2) / 3))));tofloat n3 = (float)((1 + floor(float(date.year - 4 * (floor(float(date.year / 4)+ 2) / 3)))));thanksHarald
Create an account or sign in to comment