Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
damiangr opened this issue Oct 2, 2022 · 2 comments
Labels
Milestone

Comments

@damiangr
Copy link

damiangr commented Oct 2, 2022

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
Copy link
Member

kenorb commented Oct 6, 2022

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
Copy link
Member

kenorb commented Dec 7, 2022

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

@kenorb kenorb closed this as completed Dec 7, 2022
kenorb added a commit that referenced this issue May 20, 2023
* origin/v2.010-dev:
  Should fix problem "'array' - constant variable cannot be passed [GH-661] (#660)
kenorb added a commit that referenced this issue May 21, 2023
* tag 'v2.011.1':
  Should fix problem "'array' - constant variable cannot be passed [GH-661] (#660)
kenorb added a commit that referenced this issue May 21, 2023
* tag 'v2.012.1':
  Should fix problem "'array' - constant variable cannot be passed [GH-661] (#660)
kenorb added a commit that referenced this issue Apr 24, 2024
* tag 'v2.011.1':
  Should fix problem "'array' - constant variable cannot be passed [GH-661] (#660)
kenorb added a commit that referenced this issue Apr 27, 2024
* tag 'v2.012.1':
  Should fix problem "'array' - constant variable cannot be passed [GH-661] (#660)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants