MetaTrader 5 Platform Update Build 6090: General Improvements - page 9

 
hini #:

MetaEditor bug report: /include breaks #resource resolution (error 313)

Build 6090

What the script does

  MetaEditorResource313Repro.ps1 is a self-contained reproduction for a MetaEditor command-line compile issue. It:

  1. Generates a single minimal MQL5 source file (<TerminalDir>\MQL5\Experts\ReproResource.mq5) containing only:

     Canvas/Canvas3D.mqh is MetaTrader's official include; internally, Include\Canvas\DX\DXDispatcher.mqh declares resources with #resource

     "Shaders/DefaultShaderVertex.hlsl" / "Shaders/DefaultShaderPixel.hlsl", and those .hlsl files exist at Include\Canvas\DX\Shaders\.


  2. Compiles the same source file twice with the same metaeditor64.exe:

      - Test A — without /include: compiles cleanly → Result: 0 errors, 0 warnings.

      - Test B — with /include:"<MQL5 root>": fails → Result: 2 errors, 0 warnings.


  3. Prints the last 5 lines of each compile log, a conclusion line, and optionally cleans up the generated files (-Cleanup).


  The terminal install directory can be passed with -TerminalDir (or is detected/prompted), and metaeditor64.exe can be passed with

  -MetaEditor.


What it tests


  The script tests whether adding the /include command-line switch to MetaEditor changes how #resource relative paths are resolved. Both

  compilations use identical source code and the same resource files; the only difference is the presence of /include.


 

The problem

  With /include:"<MQL5 root>", #resource directives whose paths are relative to the including file's directory are rejected with error 313:

  invalid resource path, even though the resource files exist and MetaEditor itself resolves and logs them (information: resource

  'DefaultShaderVertex.hlsl' as ...). Without /include, the identical code compiles with zero errors.


  This means the /include switch (which is needed to make #include search work from arbitrary source locations) conflicts with #resource

  resolution — code that compiles fine without /include fails with error 313 as soon as /include is supplied.


Expected behavior

  Adding /include should not change how #resource relative paths are resolved. A resource file that exists next to the .mqh (and is found

  and logged by the compiler) should not be reported as invalid resource path.

Reproduce and confirmed. Reported to MQ attention.
 
rkdius #:

You're right, thanks for backing me up (unintentionally!)

But I can expect developers to make it better.

Next time try without personal attacks. Let's keep it civil and talk about facts!

Personal attacks? - Wut???

...to make it better. -> Define "better" in this context.


 
Vladislav Boyko #:

Why can't I delete a tag through the web interface? Repository link: tag-deletion-issue

Fixed.
 
rkdius #:

You're right, thanks for backing me up (unintentionally!)

But I can expect developers to make it better.

Next time try without personal attacks. Let's keep it civil and talk about facts!

Banned forever for repeated trolling.
 
hini #:

MetaEditor bug report: /include breaks #resource resolution (error 313)

Fixed in 6140.