What is wrong here? Error: cannot cast int to SYSTEMTIME

Steven Schveighoffer schveiguy at yahoo.com
Tue Oct 23 09:26:43 PDT 2007


I have seen this error before.  It was a bug in the compiler 
(http://d.puremagic.com/issues/show_bug.cgi?id=1300).  Try upgrading to 
latest, I have dmd 1.021 (1.019 fixed this bug).

Once you do upgrade, you will find that you get a much more descriptive 
error, because BCS is right, static initializers must be evaluated at 
compile time.  Follow his instructions to get it working how you want.

-Steve

"Spacen Jasset" wrote
> Digital Mars D Compiler v1.015
>
> Neither of these lines will compile and give: Error: cannot cast int to 
> SYSTEMTIME
>
> without a line number. How might I get this to work?
>
>
> import std.date;
>
> //long utc_time1 = std.date.getUTCtime();
>
> void main()
> {
> //static long utc_time1 = std.date.getUTCtime();
> }
>
> Regards,
> Jason 




More information about the Digitalmars-d-learn mailing list