I've got .mqh
source code file with syntax error, for example created by the following command:
echo some_error > fail.mqh
Now, I'm using Metaeditor compiler to check the syntax and my goal is to print the errors to the standard output (CON
), instead of logging them to the file (/log:file.log
). See: Compiling.
The following syntax works fine on Linux/macOS as follow (also under wine cmd.exe
):
$ wine metaeditor.exe /s /log:CON /compile:fail.mqh
??fail.mqh : information: Checking 'fail.mqh'
fail.mqh(1,1) : error 116: 'some_error' - declaration without type
fail.mqh(1,1) : error 161: 'some_error' - unexpected end of program
: information: Result 2 error(s), 0 warning(s)
Please note that the /log
parameter is required, otherwise the compiler doesn't print anything by default. So if /log
is specified, then by default it logs the compilation result to the file. And I'm using special CON
device to display the errors.
The problem is when I'm running the same command on Windows (cmd), then I've got no output:
> metaeditor.exe /s /log:CON /compile:fail.mqh
Same for CON:
/con:
as well. Also on PowerShell.
Although CON
works for echo
, e.g.: echo test > CON
.
I could assume it could be a bug of the compiler, but then it works fine under Wine. Why would this work only under Wine?
Is there another way of outputting the errors to the terminal screen on Windows, instead of log file?
Note: You can install compiler from the site or download the binary (32bit or 64bit) to test above.
Clarification: My main blocker for using two separate commands (compile and print the error log after that) is that CI test may fail before the errors are printed, which makes the tests useless and it's a story for another question. So my goal is to check the syntax and print the errors at one go.
/log:CON
and eventually add an error output redirection `2>&1' – Celisse/log
is specified, so it logs the compilation result to the file by default. – Glyoxaline/log:con:
– Celissetype
ormore
should display utf-16 (inside font/codepage limits) properly to the screen. – Celisse??
at the beginning, but somehow the rest is fine. Printing log viatype
on Win10 is fine. On Linux/macOS,cat
/vim
works fine, butgrep
/less
/more
and other tools sees it as a binary file. – Glyoxaline