Linux -> Windows crosscompiler

Mike Parker via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Tue May 16 01:58:57 PDT 2017


On Tuesday, 16 May 2017 at 08:25:46 UTC, Marvin G├╝lker wrote:
> On Tue, May 16, 2017 at 07:49:53AM +0000, kinke via 
> digitalmars-d-ldc wrote:
>> Yeah, that's what I meant by whether you are fine with the 
>> toolchain.
>
> Heh. After running MSVC Setup's "Repair" program (which, again, 
> took an hour or so) Visual Studio now starts. And then closes 
> with the message "Your evaluation time span has expired" 
> (although I never even used it). I don't think I'm going to 
> feel familiar with MSVC at any point in time. What a crude 
> world Windows is.

The Community Edition (both 2015 and 2017) can be used in 
perpetuity if you have a Microsoft account.

For reference, here's how object file compatibility works on 
Windows between the different C & D compilers:

* Don't mix any C objects compiled with MinGW with any D compiler 
other than GDC. You'll generally want to ensure the version of 
MinGW you use matches that backing GDC.

* MSVC-generated object files will work with LDC and with DMD, 
but you have to use either -m64 or -m32mscoff when compiling your 
D source using DMD.

* Vanilla DMD (which defaults to -m32) uses OPTLINK to link and 
therefore expects object files to be in OMF format. MSVC and 
MinGW output COFF, so objects they produce will need to be 
converted to OMF when linking with your D stuff (and you still 
may wind up with linker errors or compatibility problems). You'll 
generally want to compile your C files with DMC in this scenario.




More information about the digitalmars-d-ldc mailing list