Dub and GtkD

Mike Wey mike-wey at example.com
Sun Dec 22 03:58:20 PST 2013


On 12/21/2013 11:19 PM, qznc wrote:
> On Saturday, 21 December 2013 at 14:52:08 UTC, Russel Winder wrote:
>> I just created a new vibe.d project using dub, all fine. Well once I had
>> solved the libevent problem. Then, as the project is to be a GUI client,
>> I added a gtk-d dependency.  I tried building the empty project and the
>> binary comes out at 42MB. Not only that there are two copies of it one
>> in . and one in ./.dub/build. I was gobsmacked, this isn't Go, there
>> should be dynamic linking by default.  Is this something I have missed?
>>
>> There ought to be a clean target for dub as well as a build and run
>> target for dub, or have I missed something?
>>
>> Re GtkD, when I run the "Hello World" vibe.d web server with GtkD doing
>> nothing, I get:
>>
>>
>> |> dub
>> Checking dependencies in
>> '/home/users/russel/Repositories/Git/Masters/ArcamClient_D'
>> Target is up to date. Skipping build.
>> Running ./arcamclient
>> Listening for HTTP requests on ::1:8080
>> Listening for HTTP requests on 127.0.0.1:8080
>> Please open http://127.0.0.1:8080/ in your browser.
>> object.Exception at ../../../../.dub/packages/gtk-d-master/src/gtkc/Loader.d(127):
>> Library load failed: libgtkglext-3.0.so.0
>> Error: Program exited with code 1
>>
>>
>> In an earlier thread here, Mike Wey's response was "download libgtkglext
>> and build it yourself". I am not sure this is the right approach. Debian
>> packages GNOME 3 quite well but they do not have this
>> libgtkglext-3.0.so.0 and yet things work. I think mayhap GtkD should
>> have this as an optional dependency rather than a mandatory one. Or am I
>> missing something?
>
> For some reason GtkD uses some unreleased version of Gtk with some
> OpenGL features.

This is because the released version of GtkGLext doesn't support Gtk+ 3.x.

> You can use the "normal/stable" variant by adapting
> your dependency a little:
>
> "dependencies": { "gtk-d:gtkd": "~master" }

Just depending on the subpackage you need will stop dub from including 
the other parts of GtkD in your app. So this should fix your problem.

> Not sure, why GtkD does this. There are also no versions, just "~master".

-- 
Mike Wey


More information about the Digitalmars-d-learn mailing list