compile
Compile MQL source files and receive structured diagnostics. Identifies errors with file, line, column, and code, confirming whether a fresh binary was produced.
Instructions
Compile one MQL source with MetaEditor and return structured diagnostics.
ok is true only when the log has a Result: line with 0 errors AND (unless
syntax_only) a fresh .ex5/.ex4 was produced (binary_fresh). Fix every entry in errors
(file, line, col, code, message) and call again; warnings do not block deployment.
Takes 1-30 s. To also copy the binary into Experts/ use compile_and_deploy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Absolute Windows path to the .mq4/.mq5/.mqh source file. | |
| include | No | MQL root folder (parent of Include/) if different from the active terminal's. | |
| log_file | No | Explicit path for the compile log; defaults to .mt5tmp/<stem>.compile.log next to the source. | |
| syntax_only | No | true = MetaEditor /s syntax check only: faster, produces no binary. | |
| timeout_sec | No | Give up after this many seconds. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||