RejectedSoftware Forums

Sign up

Starting problems with dub and the dlangui library

Hello everyone,

I'm still a beginner in programming and after I worked my way through "Programming in D" by Ali Çehreli, I wanted to try out some GUI programming. I've found the dlangui library and decided to start there.
The first steps according to the wiki

dub init dgui dlangui

and

cd dgui
dub run

with the following app.d:

import std.stdio;

void main()
{
    writeln("Edit source/app.d to start your project.");
}

went fine using my arch linux system, but using Windows 10 I got the following output:

C:\Users\es7uary\programming\d\dgui>dub run
Performing "debug" build using dmd for x86.
derelict-util 2.0.6: target for configuration "library" is up to date.
derelict-ft 1.1.2: target for configuration "library" is up to date.
derelict-gl3 1.0.18: target for configuration "library" is up to date.
derelict-sdl2 2.0.0: target for configuration "library" is up to date.
dlangui 0.8.36: target for configuration "default" is up to date.
dgui ~master: target for configuration "application" is up to date.
To force a rebuild of up-to-date targets, run again with --force.
Copying files for dlangui...
Running .\dgui.exe
Program exited with code 1

(It's the 2nd try of dub run)

As you can see the Edit source/app.d to start your project. output is missing.
Does anyone got an idea what the reason for this misbehaviour could be?
The strange thing is when I replace the simple content of app.d with the first dlangui example, everything works fine and the window with the desired button appears. However, the existing error of a simple writeln statement still leaves me uncomfortable.

Best regards

Re: Starting problems with dub and the dlangui library

On Sat, 16 Jul 2016 00:31:12 GMT, Es7uary wrote:

(...)
went fine using my arch linux system, but using Windows 10 I got the following output:

C:\Users\es7uary\programming\d\dgui>dub run
Performing "debug" build using dmd for x86.
derelict-util 2.0.6: target for configuration "library" is up to date.
derelict-ft 1.1.2: target for configuration "library" is up to date.
derelict-gl3 1.0.18: target for configuration "library" is up to date.
derelict-sdl2 2.0.0: target for configuration "library" is up to date.
dlangui 0.8.36: target for configuration "default" is up to date.
dgui ~master: target for configuration "application" is up to date.
To force a rebuild of up-to-date targets, run again with --force.
Copying files for dlangui...
Running .\dgui.exe
Program exited with code 1

It's probably not this, but a guess would be that for some reason stdout (and stderr) are not valid handles, which would cause an exception to be thrown. However, I have no idea why that would happen, considering that the output from DUB appears normally.

If you have installed VisualD, you could try to run dub generate visuald from the d\dgui directory and then use the debugger to see where it fails (may require to set a breakpoint at the __d_throwc function). I'll try to reproduce this later when I get to a Windows machine to see if I can help with this.