2

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.

a4194304
  • 366
  • 2
  • 13
  • Did you put it under: `\MQL4\Libraries\`? – not2qubit Dec 11 '19 at 18:28
  • @not2qubit my MT4 editor script was autometically stored in some place like `C:\Users\\AppData\Roaming\A810BDDCC..\MQL4`. and yes the file MyLibrary.ex4 is stored under \Libraries so that original EA can use it. BTW: This error already indicates the corresponding ex4 has been found, but the function which inside not – a4194304 Dec 12 '19 at 06:26
  • What compiler are you using and are you compiling in 23 or 64 bit mode? *`There is a 32-bit requirement for the DLL for MT4. 64 bit does not support.`* from [here](https://www.mql5.com/en/forum/293517#comment_9811172). – not2qubit Dec 12 '19 at 10:30
  • Please paste the entire message and some lines before and after. And look at [this](https://www.mql5.com/en/forum/99501). – not2qubit Dec 12 '19 at 10:35

1 Answers1

1

Finally I made the solution: Explicitly delete the ex4 file you compiled before, then click the recompile button, and it is resolved. It seems when the file exists, re-compile the file cannot override some configs that is malfunctioned in my side, so you must find the directory of your ex4 file and manually remove it.

a4194304
  • 366
  • 2
  • 13