How to compile with GtkD

mark mark at qtrac.eu
Sun Feb 9 11:52:19 UTC 2020


According to the GtkD web site https://gtkd.org/ this GUI library 
is cross-platform, so hopefully just what I need.

The introductory blog 
https://gtkdcoding.com/2019/01/11/0000-introduction-to-gtkDcoding.html explains how to install and get started with GtkD on Windows (which I plan to use later on), but right now I want to start on Linux and I'm stuck.

I have LDC in $HOME/opt/ldc2-1.19.0-linux-x86_64 with the bin/ 
dir in my path, and GtkD 3.9.0 in $HOME/opt/GtkD3

I am trying to build a simple "hello world" app (from the 
gtkDcoding blog) in $HOME/app/d/gtktest (which is a dub init 
created directory) and have this dub.sdl:

name "gtktest"
description "Gtk Test"
authors "Mark"
targetType "executable"
dependency "gtk-d:gtkd" version=">=3.9.0"
importPaths "$HOME/opt/GtkD3"
libs "libgtkd-3"

The error I get is:

$ dub
Performing "debug" build using /home/mark/opt/bin/ldc2 for x86_64.
gtk-d:gtkd 3.9.0: target for configuration "library" is up to 
date.
gtktest ~master: building configuration "application"...
Linking...
/usr/bin/ld.gold: error: cannot find -llibgtkd-3
collect2: error: ld returned 1 exit status
Error: /usr/bin/cc failed with status: 1
/home/mark/opt/bin/ldc2 failed with exit code 1.

$ cd ~/opt/GtkD3
$ ls *.a
libgstreamerd-3.a
libgtkd-3.a
libgtkdsv-3.a
libpeasd-3.a
libvted-3.a

I also tried specifying libs as "gtkd-3" and had the same problem.

I can run $HOME/opt/GtkD3/TestWindow and it works fine. And I can 
also build it in $HOME/opt/GtkD3/demos/gtkD/TestWindow. However, 
it uses a dub.json with "dependencies": { "gtk-d:gtkd": {"path": 
"../../../" }, } and I don't know what the dub.sdl equivalent of 
this is. (I prefer .sdl to .json.)



More information about the Digitalmars-d-learn mailing list