Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use gtkD in Win7 and dmd (D2)?

I downloaded gtkD-1.5.1 and extracted to some gtkD directory. What do I do next ? I don't understand if I have to compile and link it to some lib or just link to it in my code ?


Edit: (@dsimcha)

the command dsss build in gtkD main dir gave me this:

Could not detect versions.
Could not detect versions.
Could not detect versions.
Could not detect versions.
Could not detect versions.
undemofy

Could not detect versions.
Could not detect versions.
atk => DO-atk

cairo => DO-cairo

gdk => DO-gdk

gdkpixbuf => DO-gdkpixbuf

gio => DO-gio

glade => DO-glade

glib => DO-glib

gobject => DO-gobject

gthread => DO-gthread

gtk => DO-gtk

gtkc => DO-gtkc

pango => DO-pango

but no lib was created ?

like image 787
Tar Avatar asked Jan 03 '12 20:01

Tar


3 Answers

I had problems using DSSS on Windows as well, you could try using Bud/Build.

Make sure that build.exe is in your path somewhere, then open a command line in your gtkD/src/build folder. Then run build gtkD.brf to create GtkD.lib.

Depending on your version of DMD, you'll get a lot of errors. Most of the ones I got was typedef being deprecated. Any file where that happened (it will tell you) I simply refactored typedef into alias, and it worked fine. The other error I got was with src/gtk/Toolbar.d, and an ambiguous virtual function getOrientation(). To fix this, go into src/gtk/OrientableIF.d and /src/gtk/ToolShellIF.d and comment out the getOrientation methods.

Using the most recent version of dmd (2.059), glib/DateTime.d won't compile. To make this file compile, simply comment out the method override hash_t toHash().

When you compile your project, use dmd <source files> -L <C:\Path\To\File>\GtkD.lib

like image 119
Cedrick Cooke Avatar answered Oct 19 '22 13:10

Cedrick Cooke


Imanage to use GtkD without generating lib files, with rdmd.

  1. You must install Gtk+2 runtime
  2. Download GtkD source code to some dir
  3. Run rdmd --build-only -I/src

rdmd will autobuild GtkD and your project code alone, skipping the need to making libs and linking it manually.

like image 1
Zardoz89 Avatar answered Oct 19 '22 13:10

Zardoz89


You need to compile gtkD into a binary. The standard way to do this is with DSSS. Basically, download and install DSSS, and then do a dsss build from the main gtkD directory.

Edit:

After you build gtkD using DSSS, you'll have a bunch of .lib files in the gtkD directory. You statically link these into your application. In addition, you need to have the GTK+ libraries installed in your Windows installation.

like image 1
dsimcha Avatar answered Oct 19 '22 13:10

dsimcha