On Friday, 5 August 2016 at 21:36:07 UTC, A D dev wrote:

What Microsoft tools are you referring to? Do you mean C toolchain build tools, like the linker, librarian, (N)MAKE, etc.? Does D depend on those on Windows? (I do remember reading a D doc, maybe the overview, that said something like that, or at least that it plays well with existing common toolchains.)

DMD ships with the OPTLINK linker and uses it by default. OPTLINK uses object files in the OMF format. If you want to compile and link any C or C++ libraries, they also need to be OMF. You can achieve that by converting object files from COFF to OMF or by compiling with DMC if possible.

OPTLINK does not support 64-bit, so if you want to compile 64-bit with DMD (using the -m64 switch) you need the MS linker installed as DMD will create objects in the COFF format (you can also get 32-bit COFF objects with -m32mscoff switch). That means you either need to install the MS build tools [1] or some version of Visual Studio (the Community Edition is free [2]). If you install only the build tools, you will also need the Windows SDK [3] to use the system libraries in COFF format. Visual Studio comes with everything you need.

I don't know if the DMD installer will discover the build tools installation for you yet, as I've never tried it. But it will definitely find Visual Studio.


I don't remember all of the names of the Windows C build tools now (plus, they could have changed over time), have to do a bit of reading to brush up / update myself on that. I've done C dev on Windows (and DOS before it), including command line use of the MS compiler and linker (CL.exe, LINK.exe, IIRC), but all that was some years ago.

You generally don't need to worry about calling them directly unless you plan to compile any C or C++ source to link with your 64-bit (or -m32mscoff) D apps. As long as they are installed and DMD knows where to find the linker and any system libraries you need, that's enough.


[1] https://www.microsoft.com/en-us/download/details.aspx?id=48159
[2] https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx [3] https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk



Reply via email to