When you need to create a library to be used with #import, it must be marked as library and have a defined interface. Did you specify that?
Anyway, the mqh is intended for source code inclusion, and it does not even need to compile alone. But you may include it into your library as well, even if the library contained only the library directive and the inclusion.
When you need to create a library to be used with #import, it must be marked as library and have a defined interface. Did you specify that?
Anyway, the mqh is intended for source code inclusion, and it does not even need to compile alone. But you may include it into your library as well, even if the library contained only the library directive and the inclusion.
Yes I defined:
#property library
and the mqh-file is saved in \Libraries but even there no ex4?
Yes I defined:
and the mqh-file is saved in \Libraries but even there no ex4?
It has to be a mql4 source file not a mqh.
Yes that is the problem. When you create an include file, the file is saved uncompiled as .mqh in the MQL4\Include folder. When you create a library file it is a regular .mq4 file compiled to an .ex4. and saved in MQL4\Librarys. You could open a new library file in Metaeditor, copy paste the source code from your include file, compile the library file then try to import it to the main file.
ok, thanks, understood,
Gooly
- 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 wrote my TimeShift-include-file. It is saved in ...\MQL4\Include\..
I compiled it with no errors and no warnings, an can use it by
#include <TimeShifts.mqh>
But if I want to use it in an imported way:
It cannot be used??
I can compile the indi. that 'imports' it without errors and only some warnings: 'i' is not used..
But starting this indicator I get this in the expert-tab:
Beside that I can't find the "TimeShifts.ex4" in \Include (nor in \Experts), neither in the /portable-Folder-structure nor in the default folder-structure?
What shall I do, what went wrong?
Gooly
PS: If I define in such an include-file global variables how can I use them directly in the loading indi. or EA and not by an extra defined function that just gives back this value?