Even more simple approach to setup gtkD.

Since gtkD is available as dub package, we can simply install dub package manager, which will take care of our gtkD dependency leading to a very simple way to setup everything. https://code.dlang.org/packages/gtk-d

Follow these steps to install required software:

sudo snap install --classic dmd
sudo snap install dub

After successful installation, create a new text file and simply drop your "example application" program inside it:


#!/usr/bin/env dub
/+ dub.sdl:
	name "hello"
	dependency "gtk-d" version="*"
import gtk.MainWindow;
import gtk.Label;
import gtk.Main;

void main(string[] args)
    MainWindow win = new MainWindow("Hello World");
    win.setDefaultSize(200, 100);
    win.add(new Label("Hello World"));

Use dub package manage to run your hello.d example via:

dub hello.d

The result is the same:
An example program