D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19821 - Cannot pass linker argument with spaces
Summary: Cannot pass linker argument with spaces
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All Windows
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-24 18:37 UTC by Jacob Carlborg
Modified: 2019-10-18 06:13 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jacob Carlborg 2019-04-24 18:37:41 UTC
With an empty D file, running the following command:

dmd main.d -L/LIBPATH:"C:\Program Files" -v -m64

Will output, among other things:

/LIBPATH:C:\Program Files

And fail with:

LINK : fatal error LNK1181: cannot open input file 'Files.obj'

The problem is that the path should be quoted because it contains spaces.
Comment 1 Jacob Carlborg 2019-04-25 09:26:36 UTC

*** This issue has been marked as a duplicate of issue 16677 ***
Comment 2 Dlang Bot 2019-10-18 06:13:10 UTC
dlang/dmd pull request #10459 "[stable] Fix linker flags with blanks on Windows" was merged into stable:

- ec6de46e76efd34d3f8a5d97f89cd1f42beb1cdd by Martin Kinkelin:
  Fix linker flags with spaces on Windows
  
  Fixes issue 19821 and 16677 for MS link.exe only (I haven't checked
  Optlink).

https://github.com/dlang/dmd/pull/10459