MetaEditor CLI fails silently on large modular projects

 
Hello,

I'm having an issue where compiling a .mq5 file from the command line (MetaEditor64.exe /compile:<path> /log:compile.log) silently fails without generating an .ex5, no errors and no logged issues. I stumbled upon this issue whilst using Visual Studio Code in combination with the MQLTools extension.

This only occurs when:
- A large number of modular .mqh files are included.
- The program constructs several deeply nested objects inside OnInit().
- Singleton-based utility wrappers are used (e.g., inline CClass* Class(void){ return(Class::Instance()) } ).
- When I comment out object construction in OnInit(), the exact same file compiles successfully.
- This failure is silent — no errors, no warnings, no .ex5. Only the list of included files appears in the log.

What I tried:
- Removing all inline keywords.
- Ensuring no path issues or syntax errors.
- Verifying same file compiles fine from MetaEditor GUI.
- Increasing TimeToMiniTerminal in MetaEditor settings to "compile MQL file using script". When using the script; the terminal opens, starts compiling, then closes before it finished compiling.

Request:
- Please clarify whether there is a known complexity/memory/symbol limit in MetaEditor CLI.
- If possible, can the CLI version be updated to:
- Report a proper error when compilation aborts silently?
- Or document the limits for inline/constructs/symbols/includes?

This issue seems related to parser/stack exhaustion and reminds me of deep #include chain behaviour in C++ without compiler paging.
Having some visibility into these limits or a diagnostics mode for the CLI would help me, and I'm sure a handful of others, tremendously.

Thank you!
 
Winged Trading:

your issue reads like you should be sending a msg to both support and post below the release version of your mt4/5 thread.

But without an example of code that you know will replicate the issue, how can you expect any response? This is a technical forum after all.

 
Hello,

I previously reported an issue with the MetaTrader CLI compilation silently failing.
My original thoughts have not been the right one, so I apologize if this caused any hassle.

After digging deeper, trying to recreate the issue, I found it occurs when using a vector function. Specifically vector::Resize(). 

I have provided examples code snippets and software versions below.

Uncompilable example:

int OnInit()
{
   vector v;
   v.Resize(1000);
   return(INIT_SUCCEEDED);
}

Output:

[Starting] [20:42:54] Compiling >>> Reproducer2.mq5 <<< 
'Reproducer2.mq5'
 453 msec elapsed

Compilable example:

int OnInit()
{
   // vector v;
   // v.Resize(1000);
   return(INIT_SUCCEEDED);
}

Output:

[Starting] [20:43:12] Compiling >>> Reproducer2.mq5 <<< 
'Reproducer2.mq5'
[Done] Result: 0 errors, 0 warnings, 651 msec elapsed, cpu='X64 Regular'


VSCode
- Version: 1.102.2 (user setup)
- Commit: c306e94f98122556ca081f527b466015e1bc37b0
- Date: 2025-07-22T12:15:48.520Z
- Electron: 35.6.0
- ElectronBuildId: 11847422
- Chromium: 134.0.6998.205
- Node.js: 22.15.1
- V8: 13.4.114.21-electron.0
- OS: Windows_NT x64 10.0.19045

MQL Tools
- Identifier: l-i-v.mql-tools
- Version: 2.2.0
- Last Updated: 2025-05-02, 21:52:33


Please confirm whether this is a bug with CLI compilation of vector functions.
If yes, can this be fixed?
GUI compilation works correctly, but CLI compilation fails silently.


Thank you.

 

I got a response from the MQL5 team. 

To any one having the same issue, updating to build 5200 fixes it. 

Thank you all.