Critical Compiler Bug in Build 5147: Fails on Predefined __MQL5__ Structure

 

Hello,

I am experiencing a critical compiler bug in MetaEditor build 5147. The compiler consistently fails on 100% syntactically correct MQL5 code, producing basic errors like "object required" and "; - unexpected token".

I have performed extensive troubleshooting to isolate the issue, including the following steps:

  1. Tested multiple versions of a complex Expert Advisor. The error persisted, appearing on different, but always correct, lines of code.

  2. Performed a full, clean reinstallation of the MetaTrader 5 platform using the latest installer from the official website. This was done after restarting the PC and with antivirus software disabled. The problem remained.

  3. To definitively isolate the failure point, a minimal validation script ( SystemValidator.mq5 , code provided below) was created.

This minimal script also failed to compile. The error occurs specifically when trying to access the predefined __MQL5__ structure, which is a fundamental part of the MQL5 language. This proves that the compiler itself is faulty and cannot process basic language constructs on my system. The issue is not with the MQL5 code, but with the compiler environment's interaction with my OS.

Please investigate this issue.

Technical Details:

  • MetaEditor Version: Version: 5.00 build 5147

  • Operating System Information:

    • Edition: Windows 11 Pro

    • Version: 24H2

    • OS Build: 26100.4652

    • Installation Date: 13.07.2025

Error Messages and Proof:

The error occurs on line 19 of the

SystemValidator.mq5 script.

  • The Failing Line: PrintFormat("MQL5 Version: %d", __MQL5__.version);

  • Error Messages: object required ,

    ';' - unexpected token

(I have attached the screenshot of the compilation log for SystemValidator.mq5 which shows these errors.)

Minimal Code That Causes the Error:

//+------------------------------------------------------------------+
//|                      SystemValidator.mq5                         |
//|    A minimal script to test core MQL5 compiler functions.      |
//+------------------------------------------------------------------+
#property version   "1.00"
#property description "Tests compiler stability for basic functions."

//--- Global Variables
string G_LABEL_NAME = "ValidatorLabel";
int    g_tick_counter = 0;

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
{
    // --- Test 1: Accessing the __MQL5__ predefined structure ---
    Print("--- System Validator Script Started ---");
    PrintFormat("MQL5 Version: %d", __MQL5__.version); // THIS IS THE LINE THAT FAILS
    PrintFormat("MQL5 Build: %d", __MQL5__.build);
    PrintFormat("Program Name: %s", MQLInfoString(MQL_PROGRAM_NAME));

    // --- Test 2: Basic Object Creation ---
    ObjectCreate(0, G_LABEL_NAME, OBJ_LABEL, 0, 0, 0);
    ObjectSetInteger(0, G_LABEL_NAME, OBJPROP_CORNER, CORNER_RIGHT_UPPER);
    ObjectSetInteger(0, G_LABEL_NAME, OBJPROP_XDISTANCE, 20);
    ObjectSetInteger(0, G_LABEL_NAME, OBJPROP_YDISTANCE, 20);
    
    // Cleanup
    ObjectDelete(0, G_LABEL_NAME);
    Print("--- System Validator Script Finished ---");
}