Hi
If I understand you correctly, you need to simply declare the struct before declaring the variable.
Can you simply declare the struct in the header file? Or declare the variable in the mql file (below the struct definition). This would be the simplest solution.
Best Regards
Hi
If I understand you correctly, you need to simply declare the struct before declaring the variable.
Can you simply declare the struct in the header file? Or declare the variable in the mql file (below the struct definition). This would be the simplest solution.
Best Regards
Yeah you are correct. I was using the struct (present in mqh) before it was declared (in parent file). I solved it by just moving the #include <...mqh> after my declaration of struct.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I have a EA which has a struct defined in it (because there are variables of its type in the EA mql file) and the struct type is being used to declare a variable in the header file too.
After i include the mqh file in EA and compile i get error:
'LLevel' - unexpected token, probably type is missing?
Is it not possible to use parent mql file's variables and struct defined , within included mqh file?
Is there a workaround?
How do programmers generally deal with this problem?