#include references on a Mac

 

Hello,


Does anybody know how to code #include folder references in eas on a Mac? I have specified the entire location with forward slashes but it won't compile because it is looking for c:\Program Files which of course doesn't exist on a Mac.


Thanks

Phil

 

Hello

If you write (for example) #include <Trade/Trade.mqh> your EA automatically find the Trade.mqh file on the include folder of MetaTrader5

 
Charles, Marie Tilly #:

Hello

If you write (for example) #include <Trade/Trade.mqh> your EA automatically find the Trade.mqh file on the include folder of MetaTrader5

No it doesn't because it is still looking for c:\Program Files which doesn't exist on a Mac

 

Strange ... that's work great for me ...


You can use the function TerminalInfoString(TERMINAL_DATA_PATH) to return string of the data path and add "\\MQL5\\Include" after.

 
Charles, Marie Tilly #:

Strange ... that's work great for me ...


You can use the function TerminalInfoString(TERMINAL_DATA_PATH) to return string of the data path and add "\\MQL5\\Include" after.

Thanks. I've tried running  TerminalInfoString(TERMINAL_DATA_PATH) and it has just returned c:\Program Files again

 

MetaTrader on Mac works with a Windows emulation from Wine ...

You talk about "ProgramFiles" but the in windows, "Includes" folder is on "C:\Users\Login\AppData\Roaming\MetaQuotes\Terminal\".
What is the path openned when you clic on "Open Data folder" in MT5 Files Menu ?

 
Charles, Marie Tilly #:

MetaTrader on Mac works with a Windows emulation from Wine ...

You talk about "ProgramFiles" but the in windows, "Includes" folder is on "C:\Users\Login\AppData\Roaming\MetaQuotes\Terminal\".
What is the path openned when you clic on "Open Data folder" in MT5 Files Menu ?

It doesn't give the path in the data window. It just says MetaTrader 4.(I'm on MT4 by the way.)

 
Sneck55 #: It doesn't give the path in the data window. It just says MetaTrader 4.(I'm on MT4 by the way.)
  1. Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
    Next time, post in the correct place. The moderators will likely move this thread there soon.

  2. He said File (Alt+F) → Open Data Folder (D) and verify you put it in the correct location (MQL4/Include). Not the Data Window (Control+D)
 
William Roeder #:
  1. Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
    Next time, post in the correct place. The moderators will likely move this thread there soon.

  2. He said File (Alt+F) → Open Data Folder (D) and verify you put it in the correct location (MQL4/Include). Not the Data Window (Control+D)

Yes William it is in the correct location: the file can be viewed by opening File/Open Data Folder and is in the "Include" folder. It is how to specify the path in the EA which is the issue and not the folder because I am using a Mac.

 
Sneck55 #: Yes William it is in the correct location:

No, it is not. MT4 has its own section.

Reason: