I have edited your improperly formatted code. In the future, please use the CODE button (Alt-S) when inserting code.
MQL5.community - User Memo
- www.mql5.com
You have just registered and most likely you have questions such as, "How do I insert a picture to my a message?" "How do I format my MQL5 source code?" "Where are my personal messages kept?" You may have many other questions. In this article, we have prepared some hands-on tips that will help you get accustomed in MQL5.community and take full advantage of its available features.
Either put the structure definition above the include in file 1. Or place it in file 2 where it really belongs
When you do things in order compiling file 1 it does not know about the structure art time of including file 2 which references an unknown structure therefore
Fernando Carreiro #:
OK. Thank you for that!
I have edited your improperly formatted code. In the future, please use the CODE button (Alt-S) when inserting code.
Paul Anscombe #:
Either put the structure definition above the include in file 1. Or place it in file 2 where it really belongs
WoW!! It finaly works! Thank you very much!!
Either put the structure definition above the include in file 1. Or place it in file 2 where it really belongs
When you do things in order compiling file 1 it does not know about the structure art time of including file 2 which references an unknown structure therefore
file2:
You can't include yourself.
#include <file2>
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello everyone! I'm having a very strange error when a try to use a struct on my codes. the organization of my code is the following:
file1:
file2: When I compile file2, everything is OK, I get no errors or warnings. The problem is when I try to compile file1. It shows the error: undefined struct 'example' cannot be used. But this is very strange, because when I compile file2, it can see the declaration in file1.I tried to declare the struct in file2, but when I do this the metaeditor says that the struct alread exists (I know, but why the error about the declaration?). I also tried to move the struct to file2, but when I do this, file1 cannot see the declaration anymore, even with the include line and the struct prototipe. But the most strange thing is that there are many others structs in the same conditions with everything working!? Can anyone help me?