Problem with extern vars and property library

 

Hi,

I have the same problem that describes this post in this closed forum ...

https://www.mql5.com/en/forum/45531

Well, I will try to explain easily...

EA ...

#include <my.mqh>
extern int a=1;
void init(){return;}
void start(){return(a);}
void deinit(){return;}
file: my.mqh ...

#property library

In the execution of this EA the setup window NOT shows the input tab with the extern var.

but if we delete the "#property library" command in the include file, it works fine.

Any ideas for help me?

Thanks,

yotrader

 

#property library is not a command, but rather a directive for the compiler. If you include (notice the word include) it into your code, then the compiler compiles the entire code as a library, i. e. no inputs, no releasing of unused functions, no check for absence of start().

#include really includes the source code, not a library. Like if you used the copy/paste.

Reason: