You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.
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!
Why can't I delete a tag through the web interface? Repository link: tag-deletion-issue
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!
MetaEditor bug report: /include breaks #resource resolution (error 313)