Phenomenon: I've already build a library file, and the EA that uses the library has been exeucted smoothly for months. The code is just like that:
In library file:
void MyFunction(int mode)
....
In EA:
#import "MyLibrary.ex4"
void MyFunction(int mode);
#import
......
MyFunction(1);
Now I opened a new script, calling Test.mq4
and just COPY AND PASTE the related code in my EA. just like:
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#import "MyLibrary.ex4"
void MyFunction(int mode);
#import
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
MyFunction(1);
}
Executing the script. Always get the message: Unresolved function call; Cannot find "Myfunction" in MyLibrary.ex4
.
This has been occurred some times. Once I resolved it by opening a new script, copying everything in stdlib.mq4
into it, and replace the body with my own code and it worked. But this time it doesn't. I'm curious what's wrong behind it so that importing failed?
I've already recompiled the library, the EA, and the test script multiple times.