Building the Library:
I would recommend taking a look at the build guidelines for the project here are the steps that they layout to build the library:
- Get the latest stable version of DSSS and install it on your system.
- [OPTIONAL]. Update the dsss.conf file in the root of the project to
suit your needs. Otherwise pay attention to the 'defaulttargets'
key. If you want a standard gtkD build/installation, the defaults
are fine.
Build gtkD. Go to the root of the project (where this file is
located) and run the following command:
$ dsss build
You may now install the libraries to your live filesystem. From the
root of the project, run:
$ dsss install **--prefix=/usr/local**
Don't forget to set the prefix according to your needs. "/usr/local"
is a sane default and should work on most systems without further
action. If the chosen prefix is not on your PATH, don't forget to
update your environment variables. Import files will also get
automatically installed to the chosen prefix. Note: root access may
be required to complete this step according to your system settings.
- Build your own programs using the provided dsss.conf files from any
of the demo folders. Pay special attention to the buildflags used to
build the demos. "-L-ldl" is necessary on Linux systems.
- Have fun!
Using the Library:
After that you can then use the library in a few different ways in your own program depending on how your building it:
If you are using DSSS to build your own project then all you need to do is import the modules in code like this:
import gtk.MainWindow;
import gtk.Label;
import gtk.Main;
void main(string[] args)
{
Main.init(args);
MainWindow win = new MainWindow("Hello World");
win.setDefaultSize(200, 100);
win.add(new Label("Hello World"));
win.showAll();
Main.run();
}
Your dss.conf would look like this:
name = helloworld
[helloworld.d]
target = helloworld
And use the normal steps to build and install it:
$ dsss build
$ dsss install
Edit::
I just noticed that you want to use DMD directly, to compile your project you can use:
dmd helloworld.d -ofhelloworld -L+gtk.lib
Please note that this build style is not recommended for larger projects and you should use DSSS whenever practical.