question

Hao Zhou avatar image
0 Likes"
Hao Zhou asked Phil BoBo answered

Header file issue in datatypes.h

I am current working on upgrading engine from 16.1 to 17.0. After I upgrading all the header files, I found my module cannot compile due to the line of code in datatypes.h as follows:

Variant& operator =(const Property& other) { operator = ((Variant)other); return *this; }

The error message is as follows:

error C2440: 'type cast': cannot convert from 'const FlexSim::Property' to 'FlexSim::Variant'

I can make it compile either by commenting out this line or change this line to be

Variant& operator =(const Property& other) { operator = ((const Variant&)other); return *this; }

Is this a bug? Or there are reasons for this? How to make it compile without changing any header code?

Thanks, Hao

FlexSim 17.0.3
module sdk header files
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Phil BoBo avatar image
4 Likes"
Phil BoBo answered

Sorry about the issue. This file compiles correctly in VS 2013 but not VS 2015.

You can fix it by changing line 1392 of datatypes.h:

From:

Variant& operator =(const Property& other) { operator =
((Variant)other); return *this; }

To:

Variant& operator =(const Property& other) { operator = (other.operator
Variant()); return *this; }

We will get this fixed on our end in the next version, but you can change it yourself manually to fix it now.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.