[Issue 15588] New: Improve DMD -L switch documentation

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jan 21 14:43:16 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15588

          Issue ID: 15588
           Summary: Improve DMD -L switch documentation
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dlang.org
          Assignee: nobody at puremagic.com
          Reporter: john.michael.hall at gmail.com

The DMD Windows compiler switch page
https://dlang.org/dmd-windows.html#switches
provides the following information for the -L switch currently

-Llinkerflag
     pass linkerflag to the linker link.exe , for example, -L/ma/li

At a minimum, this should describe what passing /ma/li would do. I tried making
sense of it without much luck by following the link at link.exe to
http://www.digitalmars.com/ctg/optlink.html which provides the documentation
for Optlink. Is that the library path? If so, why is it using back slashes
instead of Windows-style forward slashes. At a minimum the line could be
extended to say 
     pass linkerflag to the linker link.exe. For example, -L/ma/li would pass
/ma/li to the linker link.exe. When compiling with the -m32 flag, this would
mean XXX.

I also believe that a practical use case might make things more clear. For
instance, -L is required to bind a C shared library to a D executable. How to
do this is not described well in other sources. This is motivated by a
discussion here:
http://forum.dlang.org/thread/ijkkuzelpjhkgentqxbs@forum.dlang.org

Also, when -m64 is also passed to DMD, then MS Link is used instead of OptLink.
This means that different options should be passed in that case. I believe the
relevant link is here:
https://msdn.microsoft.com/en-us/library/y0zzbyt4.aspx

--


More information about the Digitalmars-d-bugs mailing list