March 19, 2022

Is this supposed to work out of the box (see: Reddit Post)?

Trying to cross-compile a hello world program for Linux on Windows with the command dmd -os=linux main.d which gives no output on the command line but there is an error:

C:\tmp\cross_compilation_d\linux>dmd --version
DMD64 D Compiler v2.099.0-dirty
Copyright (C) 1999-2022 by The D Language Foundation, All Rights Reserved written by Walter Bright

C:\tmp\cross_compilation_d\linux>dmd -os=linux main.d

C:\tmp\cross_compilation_d\linux>echo %ErrorLevel%
-1073741795

C:\tmp\cross_compilation_d\linux>dmd -os=host main.d

C:\tmp\cross_compilation_d\linux>echo %ErrorLevel%
0

How would you set it up, if it can be set up?