Re: Must I compile on the target architecture?

2015-12-28 Thread FrankLike via Digitalmars-d-learn

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?


GDC is best for cross platform compilation,download it from 
gdcproject.org.


Re: Must I compile on the target architecture?

2015-12-28 Thread Joakim via Digitalmars-d-learn

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.


Re: Must I compile on the target architecture?

2015-12-26 Thread Orfeo via Digitalmars-d-learn

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?


See also [Should I compile D program on Linux for 
windows?](http://stackoverflow.com/questions/13501595/should-i-compile-d-program-on-linux-for-windows/13502264#13502264)


Re: Must I compile on the target architecture?

2015-12-26 Thread Jakob Jenkov via Digitalmars-d-learn
For Linux programs built on Windows... you'll prolly just want 
to copy it to a linux box.


Thanks, both of you.

I guess the easiest would be to compile it on a virtual machine 
with the OS I want to build for. I mean, I could run a Linux VM 
on my Windows box and compile my code there. Or the other way 
around.


Re: Must I compile on the target architecture?

2015-12-25 Thread Adam D. Ruppe via Digitalmars-d-learn

On Friday, 25 December 2015 at 12:43:05 UTC, Jakob Jenkov wrote:
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?


For building Windows apps on Linux, I just run the Windows 
version of dmd on wine, right from the linux box.


For Linux programs built on Windows... you'll prolly just want to 
copy it to a linux box.


Re: Must I compile on the target architecture?

2015-12-25 Thread Lucien via Digitalmars-d-learn

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?


You're right.

Simply copy your files to the target and compile.


Must I compile on the target architecture?

2015-12-25 Thread Jakob Jenkov via Digitalmars-d-learn

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?