4) However when I tried this with a EA, I can compile and run the EA fine. However, when the EA calls the function in the dll I get the following error: “cannot find 'double MLEvaluatorDLL::MLRegressionFit(double&[],int)' in module 'MLEvaluatorDLL.dll'”
At the top of both the script and the EA is the following code. It is identical in each case.
You did not show neither of your MQL5 programs (nor the script, nor the EA), so we can only speculate what's wrong.
First of all, the libraries (ex5 or dlls) are linked "statically" (so to speak) to ex5 host programs, that is they are loaded (and checked for all used imports/exports) when the main program is loaded, so the situation as you describe it "run the EA fine... when the EA calls the function in the dll I get the following error" is impossible, or you did not specify some important facts.
Second, the error “cannot find 'double MLEvaluatorDLL::MLRegressionFit(double&[],int)' in module 'MLEvaluatorDLL.dll'” references MLEvaluatorDLL library, whereas you're importing MQLEvaluatorDLL.

- 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
Apologies if this has been covered before - I have searched pretty thoroughly but did not find exactly what I was looking for. Thanks very much in advance!
1) I have a dll I wrote in c++ (based on this article, https://www.mql5.com/en/articles/18) which relies upon another dll file and a data file.
2) I started by testing this with a script. It failed when the dll, dependent dll, and required data file, were in the “..\MQL5\Libraries” folder.
3) When I moved everything to “C:\Program Files\MetaTrader 5” it worked fine.
4) However when I tried this with a EA, I can compile and run the EA fine. However, when the EA calls the function in the dll I get the following error: “cannot find 'double MLEvaluatorDLL::MLRegressionFit(double&[],int)' in module 'MLEvaluatorDLL.dll'”
At the top of both the script and the EA is the following code. It is identical in each case.
The code for the dll (c++) is very simple:
pch.h:
framework.h:
"wrapped_calcer.h" is the external dependency (a catboost implementation).