EA31337 / EA31337-classes

📦📈 EA31337 framework (MQL library for writing trading Expert Advisors, indicators and scripts)
https://ea31337.github.io/EA31337-classes
GNU General Public License v3.0
186 stars 98 forks source link

Compilation issue -'array' - constant variable cannot be passed as reference #661

Closed damiangr closed 1 year ago

damiangr commented 1 year ago

Hi , i've tried to compile v2.010 version(with MT5 ver 5 build 3446) and it gives me following errors:

'array' - constant variable cannot be passed as reference   Array.mqh   777 39
   in template 'void ArrayPushObject(X&[],X&)' specified with [X=IValueStorage*]    Array.mqh   776 6
'array' - constant variable cannot be passed as reference   Array.mqh   778 26
   in template 'void ArrayPushObject(X&[],X&)' specified with [X=IValueStorage*]    Array.mqh   776 6
kenorb commented 1 year ago

Thanks for reporting. This is due to new version of platform behaviour. The compilation worked in the previous build.

For a quick fix:

in EA31337-classes/Array.mqh line 756

search for a static int ArraySize(const ARRAY_REF(X, array)) { and remove const word.

Fix is pending in GH-660 PR.

kenorb commented 1 year ago

Fixed in v2.011.1 and v2.012.1 tags. And it's going to be fixed in the future releases.