RejectedSoftware Forums

Sign up

Problem building Dgame with Dub

This is my dub.json file:

{
    "name": "dgame practice",
    "description": "A set of practice games written in D.",
    "dependencies": {
        "dgame": ">=0.5.0",
        "derelict-sdl2": "~>1.9.7",
        "derelict-gl3": ">=1.0.17"
    }
}

And then in my code I import Dgame.Window.Window, Dgame.Graphic.Color, and Dgame.System.StopWatch.

For some reason when I try to build my project, I get this error at the linking step:

Error: module dgame is in file '.dub\build\application-debug-windows-x86-dmd_2069-315D2934D12D6AE672486AA5B93D2C58\dgame.d' which cannot be read
import path[0] = C:\D\dmd2\windows\bin\..\..\src\phobos
import path[1] = C:\D\dmd2\windows\bin\..\..\src\druntime\import
Error executing command run:
dmd failed with exit code 1.

I'm doing trying to do anything crazy so why does it fail to find this file?

Re: Problem building Dgame with Dub

On Sat, 05 Dec 2015 06:55:31 GMT, Meta wrote:

This is my dub.json file:

{
    "name": "dgame practice",
    "description": "A set of practice games written in D.",
    "dependencies": {
        "dgame": ">=0.5.0",
        "derelict-sdl2": "~>1.9.7",
        "derelict-gl3": ">=1.0.17"
    }
}

And then in my code I import Dgame.Window.Window, Dgame.Graphic.Color, and Dgame.System.StopWatch.

For some reason when I try to build my project, I get this error at the linking step:

Error: module dgame is in file '.dub\build\application-debug-windows-x86-dmd_2069-315D2934D12D6AE672486AA5B93D2C58\dgame.d' which cannot be read
import path[0] = C:\D\dmd2\windows\bin\..\..\src\phobos
import path[1] = C:\D\dmd2\windows\bin\..\..\src\druntime\import
Error executing command run:
dmd failed with exit code 1.

I'm doing trying to do anything crazy so why does it fail to find this file?

To answer my own question, the problem is that my project name had a space in it. Removing the space solved the issue.

Re: Problem building Dgame with Dub

On Sat, 05 Dec 2015 07:25:05 GMT, Meta wrote:

To answer my own question, the problem is that my project name had a space in it. Removing the space solved the issue.

BTW, the latest DUB version (0.9.24) has gotten some stricter package name checks and should error out in this case. At the same time, the build issue has also been fixed, so in case you really want the resulting binary to be "dgame practice.exe", you can now use "targetName": "dgame practice".