Skip to content

Improve DMD -L switch documentation #3950

Open
@dlangBugzillaToGithub

Description

@dlangBugzillaToGithub

John Hall reported this on 2016-01-21T22:43:16Z

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

Description

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/[email protected]

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions