Must I compile on the target architecture?

Joakim via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Dec 28 06:24:19 PST 2015


On Friday, 25 December 2015 at 12:43:05 UTC, Jakob Jenkov wrote:
> Hi, just a quick question:
>
> If I write a program in D and I use Windows for development but 
> want it to run on Linux, do I have to copy the source code to 
> the target Linux machine and compile it there, to make an 
> executable for that machine? What is the standard process for 
> cross platform compilation?

I'll also note that ldc supports cross-compilation out of the 
box.  The only issue is that you'll need a linker to link the 
resulting objects, but you can usually install one in Cygwin.  I 
believe gdc also supports some cross-compilation, though I've not 
tried it.  Dmd isn't a cross-compiler, though it is capable of 
being turned into one: nobody has put in the remaining work yet.


More information about the Digitalmars-d-learn mailing list