Download MetaTrader 5

User library problem

To add comments, please log in or register
Ingvar Engelbrecht
4504
Ingvar Engelbrecht  

I have a library "Logger" that has its main function "Loggit"

This is code that comes from MT4:

#property library
#property copyright "Copyright 2011, Maieutic."
#property link      "http://www.maieutic.com"
#property version   "1.00"

#include <stderror.mqh>
string ErrorDescription(int errorcode);
#import

int FileHandle;
double counter;
string Filenamesave="";

int Loggit(string Func, string FileName, int handle, int Logging,int PrintLog,string p1,string p2="",string p3="",
           string p4="",string p5="",string p6="",string p7="",string p8="",string p9="",string pa="")

{

-----

------

It is compiled to  an "ex5"


I have it defined in my EA:

#import "Logger.ex5"
int Loggit(string Func, string FileName, int handle, int Logging,int PrintLog,string p1,string p2="",string p3="",

           string p4="",string p5="",string p6="",string p7="",string p8="",string p9="",string pa="");

#import

When starting the EA  I get:

Cannot find 'Loggit' in 'Logger.ex5'

Documentation on MQL5: Language Basics / Preprocessor / Program Properties (#property)
  • www.mql5.com
Language Basics / Preprocessor / Program Properties (#property) - Documentation on MQL5
Ilyas
1208
Ilyas  

You should use export keyword in function declaration.

int SomeFunc() export
  {
   ...
  }
Ingvar Engelbrecht
4504
Ingvar Engelbrecht  

thanks mql5  :-)

It would help if they put it in the template you get when you start a new library

To add comments, please log in or register