Download MetaTrader 5

Unresolved import function call

To add comments, please log in or register
Make profit on MQL5 services. It's easy!
Ingvar Engelbrecht
4499
Ingvar Engelbrecht 2013.12.01 21:36 

Converting an EA from MQL4 to MQL5

My library is named FXCMTFunc.ex5  and is placed in MQL5\Libraries

#property library
#property copyright "Copyright 2013, Nova Data Skr. AB"
#property link      "http://www.nova-data.se"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Read Pairs to trade from file                                    |
//+------------------------------------------------------------------+
int GetPairsToTrade(string fp, string &pairs[], string &activate[], int  &pairs_count)
 {

   int FileHandle;

-----

I declare it in my EA placed in MQL5\Experts\FXCMT\FXCMT5_00.ex5

#import "FXCMTFunc.ex5"

 int  GetPairsToTrade(string fp,string &Pairs[], string  &Activate[], int &Pairs_Count);

#import

I call it in code:

int ret = GetPairsToTrade("ForexPairs.txt",Pairs,Activate,PairsCount);

Everything compiles ok.

When I run it I get:

"unresolved import function call

"Cannot find GetPairsToTrade in FXCMTFunc.ex5"

I changed the name of the library to see if it was the whole library that was missing but that gave me another error message. So the library is found

but not the member "GetPairsToTrade"

I searched the complet directory for Metatrader if I had some bad version of the library somewhwer but none found except the one above

Documentation on MQL5: Language Basics / Preprocessor / Program Properties (#property)
Documentation on MQL5: Language Basics / Preprocessor / Program Properties (#property)
  • www.mql5.com
Language Basics / Preprocessor / Program Properties (#property) - Documentation on MQL5
Alain Verleyen
Moderator
30688
Alain Verleyen 2013.12.01 21:41  

Please use the SRC button when you post code.

You have to use the export keyword in your library.

Ingvar Engelbrecht
4499
Ingvar Engelbrecht 2013.12.05 15:32  
Thanks angevoyageur!
To add comments, please log in or register