Hi there,
I'm pretty new here and hope that this question is not that stupid. It's clear to me that I'm missing a tiny issue.
I wrote an expert (let call it expert.mq4) and within it imported an mql4 library I wrote (let say the compiled library is library.ex4).
So, in the expert I wrote:
#import "library.ex4"
int somefunction(int input);
When I compile the expert.mq4 file I get:
memory handler - Cannot allocate ~1GB of memory.
(If I omit the call to the somefunction, it compiles fine.)
Can u post that function? Are there any recursive calls anywhere in the code?
No recursive calls as far as I understand the flow.
It happends even with a simple function:
in library:
bool validateTimeFrame(int timeFrame)
{
return (timeFrame == 0 || timeFrame == 1 || timeFrame == 5 || timeFrame == 15 ||
timeFrame == 30 || timeFrame == 60 || timeFrame == 240 || timeFrame == 1440 ||
timeFrame == 10080 || timeFrame == 43200);
}
A simple call in expert (in init()):
validateTimeFrame(0);
Yes it does.
I think that the problem is that I didn't include the library or declared it in the right way, but I can't figure out what's wrong.
Is the "#property library" is needed in the library? (I do use it)
I think that the problem is that I didn't include the library or declared it in the right way, but I can't figure out what's wrong.
Maybe, but the error u got ("memory handler - Cannot allocate ~1GB of memory") doesn't make any sense in that regard...
Can u attach your files? Maybe I'll think of something...
Attached is a modified version for your check.
Thank you very much for the effort :)
#import "reUtil.ex4" bool validateTimeFrame(int timeFrame);It should be:
#import "reUtilAttach.ex4" bool validateTimeFrame(int timeFrame); #import
Both library and expert compile with no errors or warnings. I tried running the expert for a few minutes with no problems...
- 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 there,
I'm pretty new here and hope that this question is not that stupid. It's clear to me that I'm missing a tiny issue.
I wrote an expert (let call it expert.mq4) and within it imported an mql4 library I wrote (let say the compiled library is library.ex4).
So, in the expert I wrote:
#import "library.ex4"
int somefunction(int input);
When I compile the expert.mq4 file I get:
memory handler - Cannot allocate ~1GB of memory.
(If I omit the call to the somefunction, it compiles fine.)
Thanks,
Eyal