i try also in C# but unfortunately give me the sam error ( more or less )
in my VS2022 i create a library dll in C#
using System; using System.Runtime.InteropServices; using RGiesecke.DllExport; public class MyClass { [DllExport("AddNumbers", CallingConvention = CallingConvention.StdCall)] public static int AddNumbers(int a, int b) { return a + b; } }
and after in mql5
#import "MyMQL5DLL.dll" int AddNumbers(int a, int b); #import void OnStart() { int result = AddNumbers(5, 3); Print("The result is: ", result); }
i try to insert dll in the same folder in the include folder and in library folder but always not find a dll function anyone have some idea? thanks
2025.03.23 15:13:10.720 TEST (XRPUSD,M1) cannot find 'int MyMQL5DLL::AddNumbers(int,int)' in module 'MyMQL5DLL.dll'
2025.03.23 15:13:10.721 TEST (XRPUSD,M1) unresolved import function call in 'TEST.mq5' (1,1)

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi guys i try to understund how work dll import in mt5 i use this tutorial https://www.mql5.com/en/blogs/post/753426
i create a dll in VS 2022 c++ , dll ,with this code
BybitAPI.dll
and create Test.mq5
but if in dll write
{ return a + b; }
return me a function declared 'dllimport' may not be defined
'hard_math': definition of dllimport function not allowed but if i remove workbut not ofcourse return nothing , anyone know why ?
thanks