Cross compiling for windows from linux

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Jan 21 16:20:12 UTC 2021


On Thu, Jan 21, 2021 at 12:12:43PM +0000, deadalnix via Digitalmars-d wrote:
> Pretty much all is in the title.
> 
> I wanted to do this, and I don't even know where to begin. What are
> the options available?

1) Install LDC for Linux.

2) Download and unpack LDC for Windows somewhere.

3) Edit ldc2.conf and add this block:

	"(i686|x86_64)-.*-windows.msvc":
	{
	    switches = [
		"-defaultlib=phobos2-ldc,druntime-ldc",
		"-link-defaultlib-shared=false",
	    ];
	    lib-dirs = [
		"/path/to/ldc/ldc2-1.24.0-windows-x64/lib",
	    ];
	};

4) Compile your program with '-mtriple=x86_64-windows-msvc'.

5) Profit. ;-)


[...]
> PS: Glad to be back in D land. Hi everybody! I missed you!

Awesome, glad to have you back!


T

-- 
It's amazing how careful choice of punctuation can leave you hanging:


More information about the Digitalmars-d mailing list