Archived Forum Post

Index of archived forum posts

Question:

Compile errors on mono on Rpi3

Sep 08 '16 at 08:01

Hi,

I am still having problems on compiling code on RPi3 w/ Rasbian on mono, the code that compiles ok on windows:

CkDateTime ckDt = new CkDateTime();
ckDt.SetFromCurrentSystemTime();
var netDt = ckDt.GetAsDateTime(true);   // error msg points here

The error msgs look like this:

error CS1061: Type `Chilkat.CkDateTime' does not contain a definition for `GetAsDateTime' and no extension method `GetAsDateTime' of type `Chilkat.CkDateTime' could be found. Are you missing an assembly reference?

It seems that CkDateTime class has something missing on arm mono lib? I get similar errors on all CkDateTime methods...and I did try the latest arm mono lib you sent me. Any glue on what is going wrong?

Everything else in chilkat (like ssh, sftp, ftp, crypto, etc) are compiling properly.

Thanks, Matt


Answer

I now understand (remember) that any methods or properties using System.DateTime can't be in the Mono API.

But that's OK because all possible methods/properties that would use System.DateTime have an equivalent method using CkDateTime, and you can get a System.DateTime from a CkDateTime like this:

            Chilkat.CkDateTime ckdt = new Chilkat.CkDateTime();

        ckdt.SetFromCurrentSystemTime();

        bool bLocalTime = true;
        DateTime myDate = new DateTime(ckdt.GetAsDateTimeTicks(bLocalTime));

        MessageBox.Show(myDate.ToString());