A Programmer's Dilema: juggling with C, BetterC, D, Macros and Cross Compiling, etc.

Dadoum dadoum at protonmail.com
Mon May 1 16:57:39 UTC 2023


On Sunday, 30 April 2023 at 17:51:15 UTC, Eric P626 wrote:
> But how is this possible in a cross-compiling context. I am not 
> sure if I can do that with the D language either as pure D or 
> better C. DMD does not seem to offer cross compiling. GDC can 
> compile better C, but not sure mingw can compile D/betterC code.

I build programs for macOS, iOS, Windows with ldc2 
cross-compiling capabilities from my Linux computer, and the 
experience is okay, the executables are working fine but the 
set-up is a bit complicated, you need to copy files from the 
windows toolchain, copy your ldc config and edit it with some 
stuff, and do that at each ldc2 update.

If you just need cross-architecture, then gdc is a good option 
since it is compiled in a lot of cross compilation toolchains. 
However, I never managed to build a working gdc myself with ucrt 
or mingw cross-compilation capabilities, it always ends up with a 
compiler unable to link or executables that can't be executed on 
Windows.


More information about the Digitalmars-d-learn mailing list