RejectedSoftware Forums

Sign up

Problem building a simple project

I'm trying to build a project with dub, but it fails with an OPTLINK error: Error 118: Filename Expected

DUB version v0.9.17
DMD32 D Compiler v2.063.2

D:\Coding\D\test>dub init
Successfully created an empty project in 'D:\Coding\D\test'.
D:\Coding\D\test>dub
Checking dependencies in 'D:\Coding\D\test'
Building configuration "application", build type debug
Running dmd (compile)...
Linking...
OPTLINK (R) for Win32 Release 8.00.13
Copyright (C) Digital Mars 1989-2010 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Error 118: Filename Expected
Path=<...>C:\Program Files (x86)\dub
^
--- errorlevel 1
Error: Link command failed with exit code 1

Run 'dub help' for usage information.

Same with --vverbose:
D:\Coding\D\test>dub --vverbose
Using dub registry url 'http://code.dlang.org/'
Looking for local package map at C:\ProgramData\dub\packages\r
iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry libev-master
iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry libevent-maste
r
iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry openssl-master

iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry vibe-d-master
Looking for local package map at C:\ProgramData\dub\packages\r
iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry libev-master
iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry libevent-maste
r
iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry openssl-master

iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry vibe-d-master
Looking for local package map at C:\ProgramData\dub\packages\r
iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry libev-master
iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry libevent-maste
r
iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry openssl-master

iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry vibe-d-master
Looking for local package map at C:\ProgramData\dub\packages\r
iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry libev-master
iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry libevent-maste
r
iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry openssl-master

iterating dir C:\Users\oaalto\AppData\Roaming\dub\packages\ entry vibe-d-master
Failed to run git: git rev-parse failed: fatal: Not a git repository: 'D:\Coding
\D\test.git'

Note: Failed to determine version of package test at D:\Coding\D\test. Assuming
~master.
Collecting dependencies for test
Checking dependencies in 'D:\Coding\D\test'
dub initialized
Generating using build
Creating build generator.
Using config application for test
Fixing relative path: D:\Coding\D\test ~ source\app.d
Fixing relative path: D:\Coding\D\test ~ source
Fixing relative path: D:\Coding\D\test ~ views
Using config application for test
Building configuration "application", build type debug
Application output name is 'C:\Users\oaalto\AppData\Local\Temp\dub\4008643512\te
st.exe'
Running dmd (compile)...
dmd -w -g -debug -c -ofC:\Users\oaalto\AppData\Local\Temp\dub\4008643512\temp.ob
j -version=Have_test -ID:\Coding\D\test\source -JD:\Coding\D\test\views source\a
pp.d
Linking...
dmd -ofC:\Users\oaalto\AppData\Local\Temp\dub\4008643512\test.exe C:\Users\oaalt
o\AppData\Local\Temp\dub\4008643512\temp.obj -g
OPTLINK (R) for Win32 Release 8.00.13
Copyright (C) Digital Mars 1989-2010 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Error 118: Filename Expected
Path=<...>C:\Program Files (x86)\dub
^
--- errorlevel 1
Error: Link command failed with exit code 1

Full exception: object.Exception@source\dub\compilers\dmd.d(120): Link command f
ailed with exit code 1

0x004A4B12 in pure @safe void std.exception.bailOut(immutable(char)[], uint, con
st(char[]))
0x004237AF in void dub.compilers.dmd.DmdCompiler.invokeLinker(const(dub.compiler
s.compiler.BuildSettings), const(dub.compilers.compiler.BuildPlatform), immutabl
e(char)) at C:\Users\sludwig\Develop\dub\source\dub\compilers\dmd.d(120)
0x00425BB1 in void dub.generators.build.BuildGenerator.generateProject(dub.gener
ators.generator.GeneratorSettings) at C:\Users\sludwig\Develop\dub\source\dub\ge
nerators\build.d(161)
0x0040A9ED in void dub.dub.Dub.generateProject(immutable(char)[], dub.generators
.generator.GeneratorSettings) at C:\Users\sludwig\Develop\dub\source\dub\dub.d(1
62)
0x004033B6 in Dmain at C:\Users\sludwig\Develop\dub\source\app.d(257)<br>0x004A7D28 in extern (C) int rt.dmain2.drunmain(int, char, extern (C) int f<br>unction(char[][])*).void runMain()<br>0x004A7D63 in extern (C) int rt.dmain2._d_run_main(int, char, extern (C) int f
unction(char)*).void runAll()
0x004A7961 in drun_main
0x00498110 in main
0x75E3339A in BaseThreadInitThunk
0x77809EF2 in RtlInitializeExceptionChain
0x77809EC5 in RtlInitializeExceptionChain
0x004E243C in mainCRTStartup
Run 'dub help' for usage information.

Re: Problem building a simple project

Am 07.08.2013 10:37, schrieb Olli Aalto:

I'm trying to build a project with dub, but it fails with an OPTLINK error: Error 118: Filename Expected

(...)
Path=<...>C:\Program Files (x86)\dub

It's hard to judge without looking at the DMD source code, but it looks
like the PATH variable might have a syntax error somewhere. Can you
check if all path separators are correct?