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.
*** This issue has been marked as a duplicate of issue 16677 ***
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