www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Linux & DMD & GtkD

reply Ron Tarrant <rontarrant gmail.com> writes:
Hi guys,

I finally got a Linux Mint installation happening (very 
impressed, BTW) and did the usual HelloWorld.d compile with dmd, 
but I'm having trouble working out how to link to GtkD.

dmd -de -w -m64 -L+gtkd hello_gtkd_world.d

says it can't find MainWindow which tells me the gtkd libraries 
are not installed, are not included in the path, or some other 
oversight on my part.

I tried using whereis to find gtkd, but to no avail.

Questions:

1. Am I using the right syntax in the above command line?

2. How to search for things on Linux Mint

The recommendations I've found so far are for the gnome search 
tool which spits out an error:

Package gnome-search-tool is not available, but is referred to by 
another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Feb 16 2019
next sibling parent WebFreak001 <d.forum webfreak.org> writes:
On Saturday, 16 February 2019 at 13:35:57 UTC, Ron Tarrant wrote:
 Hi guys,

 I finally got a Linux Mint installation happening (very 
 impressed, BTW) and did the usual HelloWorld.d compile with 
 dmd, but I'm having trouble working out how to link to GtkD.

 dmd -de -w -m64 -L+gtkd hello_gtkd_world.d

 says it can't find MainWindow which tells me the gtkd libraries 
 are not installed, are not included in the path, or some other 
 oversight on my part.

 I tried using whereis to find gtkd, but to no avail.

 Questions:

 1. Am I using the right syntax in the above command line?

 2. How to search for things on Linux Mint

 The recommendations I've found so far are for the gnome search 
 tool which spits out an error:

 Package gnome-search-tool is not available, but is referred to 
 by another package.
 This may mean that the package is missing, has been obsoleted, 
 or
 is only available from another source
if you do it manually you will have to compile gtkd using the Makefile, move the library stuff to somewhere and add -I/path/to/gtkd/src" somewhere. You will also need to `apt install libgtk-3-dev` Maintaining GtkD with compiler and gtk updates will be kind of a pain, I recommend using dub instead to manage it all for you (except the apt install part) If you don't want to manually compile gtkd with any update breaking it, you can also use the d-apt (https://d-apt.sourceforge.io/) and `apt install libgtkd3-nn libgtkd3-dev libgtkd3-doc` But I still recommend using dub instead, you don't need to make a manual build file or remember the build command with it, you just run `dub` and it fetches and compiles GtkD if it's out of date or the compiler updated :)
Feb 16 2019
prev sibling next sibling parent reply Russel Winder <russel winder.org.uk> writes:
On Sat, 2019-02-16 at 13:35 +0000, Ron Tarrant via Digitalmars-d-learn wrot=
e:
 Hi guys,
=20
 I finally got a Linux Mint installation happening (very=20
 impressed, BTW) and did the usual HelloWorld.d compile with dmd,=20
 but I'm having trouble working out how to link to GtkD.
=20
 dmd -de -w -m64 -L+gtkd hello_gtkd_world.d
The Debian/Ubuntu/Mint way of doing things is either to just use Dub, or to install libgtkd-3-dev and then use pgk-config to determine all the correct options =E2=80=93 I usually use the packaged libgtkd-3 since it a shared ob= ject so you don't have to suffer the static linking on every build. But I also only use LDC I don't use DMD. The commands: pkg-config --cflags gtkd-3 pkg-config --libs gtkd-3 deliver up the flags and libs specifications for use with dmd and ldmd2.
 says it can't find MainWindow which tells me the gtkd libraries=20
 are not installed, are not included in the path, or some other=20
 oversight on my part.
=20
 I tried using whereis to find gtkd, but to no avail.
=20
 Questions:
=20
 1. Am I using the right syntax in the above command line?
'Fraidn not.
 2. How to search for things on Linux Mint
It's all down to pkg-config for querying for flags and options for installe= d libraries.
 The recommendations I've found so far are for the gnome search=20
 tool which spits out an error:
=20
 Package gnome-search-tool is not available, but is referred to by=20
 another package.
 This may mean that the package is missing, has been obsoleted, or
 is only available from another source
Pass, sorry. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Road m: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk
Feb 16 2019
parent reply Ron Tarrant <rontarrant gmail.com> writes:
On Saturday, 16 February 2019 at 14:29:56 UTC, Russel Winder 
wrote:

 Pass, sorry.
Thanks for the replies, guys... I quoted the above line because it's just about the only thing I understood. Let me explain... It's been almost 20 years since I used Linux and my notes are long gone. A ton of things have changed. Like, for instance, it found all my hardware this time, without me getting involved. But also the software installation managers and lots of other things are completely unrecognizable. On top of that, my brain has (unfortunately) been molded into the Windows/Microsoft way of thinking. I guess what I'm hoping for is a step-by-step, full-on-hand-holding, large-print with pictures tutorial for how to get GtkD and (I guess) dub working. I know the stuff you wrote is probably helpful, but I'm not well-enough versed in Linux or any flavour of UNIX ATM to understand it, pick which option I should use, and to put these commands in proper order. So far, as I said, dmd is working. Up until now, I've avoided dub because, with so many code examples (more than 70 at present) dub would bring in a lot of file/directory clutter. But you're saying that dub will make it easier to keep up with future changes/updates in all the various bits and bobs, so if that means I finally have to do dub, perhaps someone could point me at a good tutorial for that? Sorry if I sound ungrateful or cranky, but I have a lot on my plate ATM and I'm getting frustrated.
Feb 16 2019
next sibling parent reply Andre Pany <andre s-e-a-p.de> writes:
On Saturday, 16 February 2019 at 16:28:09 UTC, Ron Tarrant wrote:
 On Saturday, 16 February 2019 at 14:29:56 UTC, Russel Winder 
 wrote:

 Pass, sorry.
Thanks for the replies, guys... I quoted the above line because it's just about the only thing I understood. Let me explain... It's been almost 20 years since I used Linux and my notes are long gone. A ton of things have changed. Like, for instance, it found all my hardware this time, without me getting involved. But also the software installation managers and lots of other things are completely unrecognizable. On top of that, my brain has (unfortunately) been molded into the Windows/Microsoft way of thinking. I guess what I'm hoping for is a step-by-step, full-on-hand-holding, large-print with pictures tutorial for how to get GtkD and (I guess) dub working. I know the stuff you wrote is probably helpful, but I'm not well-enough versed in Linux or any flavour of UNIX ATM to understand it, pick which option I should use, and to put these commands in proper order. So far, as I said, dmd is working. Up until now, I've avoided dub because, with so many code examples (more than 70 at present) dub would bring in a lot of file/directory clutter. But you're saying that dub will make it easier to keep up with future changes/updates in all the various bits and bobs, so if that means I finally have to do dub, perhaps someone could point me at a good tutorial for that? Sorry if I sound ungrateful or cranky, but I have a lot on my plate ATM and I'm getting frustrated.
Create a file sample1.d with following content /+ dub.sdl: dependency "vibe-d" version="~>0.8.0" +/ void main() { import vibe.d; listenHTTP(":8080", (req, res) { res.writeBody("Hello, World: " ~ req.path); }); runApplication(); } Replace the dependency with the gtkd dependency and the main coding with the gtkd coding. To start the application you can use one of these commands dub sample1.d dub sample1 ./sample1 Kind regards Andre
Feb 16 2019
parent Andre Pany <andre s-e-a-p.de> writes:
On Saturday, 16 February 2019 at 16:37:17 UTC, Andre Pany wrote:
 On Saturday, 16 February 2019 at 16:28:09 UTC, Ron Tarrant 
 wrote:
 [...]
Create a file sample1.d with following content /+ dub.sdl: dependency "vibe-d" version="~>0.8.0" +/ void main() { import vibe.d; listenHTTP(":8080", (req, res) { res.writeBody("Hello, World: " ~ req.path); }); runApplication(); } Replace the dependency with the gtkd dependency and the main coding with the gtkd coding. To start the application you can use one of these commands dub sample1.d dub sample1 ./sample1 Kind regards Andre
The dependency should be dependency "gtk-d" version="~>3.8.5" You can get this into from here http://code.dlang.org/packages/gtk-d Kind regards Andre
Feb 16 2019
prev sibling next sibling parent reply Antonio Corbi <antonio ggmail.com> writes:
On Saturday, 16 February 2019 at 16:28:09 UTC, Ron Tarrant wrote:
 On Saturday, 16 February 2019 at 14:29:56 UTC, Russel Winder 
 wrote:

 Pass, sorry.
Thanks for the replies, guys... I quoted the above line because it's just about the only thing I understood. Let me explain... It's been almost 20 years since I used Linux and my notes are long gone. A ton of things have changed. Like, for instance, it found all my hardware this time, without me getting involved. But also the software installation managers and lots of other things are completely unrecognizable. On top of that, my brain has (unfortunately) been molded into the Windows/Microsoft way of thinking. I guess what I'm hoping for is a step-by-step, full-on-hand-holding, large-print with pictures tutorial for how to get GtkD and (I guess) dub working. I know the stuff you wrote is probably helpful, but I'm not well-enough versed in Linux or any flavour of UNIX ATM to understand it, pick which option I should use, and to put these commands in proper order. So far, as I said, dmd is working. Up until now, I've avoided dub because, with so many code examples (more than 70 at present) dub would bring in a lot of file/directory clutter. But you're saying that dub will make it easier to keep up with future changes/updates in all the various bits and bobs, so if that means I finally have to do dub, perhaps someone could point me at a good tutorial for that? Sorry if I sound ungrateful or cranky, but I have a lot on my plate ATM and I'm getting frustrated.
Hi Ron, For one-file programs, dub usage is very easy. Placing a minimal comment-header between /+ +/ symbol comments, gets your job done like in this example ( I think the gtkd code is from one of your examples in the blog): /+ dub.sdl: -------- name "gtkhello" dflags "-dip25" "-dip1000" dependency "gtk-d:gtkd" version="~>3.8.0" +/ /* dub run --single gtkhello.d dub build --single gtkhello.d. dub gtkhello.d <arguments to hello>. */ module gtkhello; import std.stdio; import gtk.MainWindow; import gtk.Main; import gtk.Widget; import gtk.Layout; import gtk.Button; import gdk.Event; void main(string[] args) { Main.init(args); TestRigWindow myTestRig = new TestRigWindow("Test Rig"); myTestRig.showAll(); Main.run(); } // main() class TestRigWindow : MainWindow { this(string title) { // window super(title); addOnDestroy(delegate void(Widget w) { quitApp(); } ); auto myButton = new MyButt("Button Name"); auto myOtherButton = new MyOtherButt("Other Button Name"); // layout auto myLayout = new MyLayout(myButton, myOtherButton); add(myLayout); } // this() CONSTRUCTOR void quitApp() { writeln("Bye."); Main.quit(); } // quitApp() } // class myAppWindow class MyLayout : Layout { this(MyButt myButton, MyOtherButt otherButton) { super(null, null); put(myButton, 10, 20); put(otherButton, 10, 60); } // this() } // class MyLayout class MyButt : Button { this(string labelText) { super(labelText); addOnButtonRelease(&doSomething); } // this() bool doSomething(Event e, Widget w) { writeln("Something was done."); return(true); } // doSomething() } // class MyButt class MyOtherButt : Button { this(string labelText) { super(labelText); string message = "Something other than that was done."; addOnClicked(delegate void(_) { doSomething(message); } ); } // this() void doSomething(string messageText) { writeln(messageText); } // doSomething() } --- Antonio
Feb 16 2019
next sibling parent Ron Tarrant <rontarrant gmail.com> writes:
On Saturday, 16 February 2019 at 19:11:03 UTC, Antonio Corbi 
wrote:

 For one-file programs, dub usage is very easy.

 Placing a minimal comment-header between /+ +/ symbol comments, 
 gets your job done like in this example ( I think the gtkd code 
 is from one of your examples in the blog):
 Antonio
Thanks, Antonio. That's very helpful.
Feb 18 2019
prev sibling parent Ron Tarrant <rontarrant gmail.com> writes:
On Saturday, 16 February 2019 at 19:11:03 UTC, Antonio Corbi 
wrote:

 /+
  dub.sdl:
  --------
  name       "gtkhello"
  dflags     "-dip25" "-dip1000"
  dependency "gtk-d:gtkd" version="~>3.8.0"
  +/

 /*
   dub run --single gtkhello.d
   dub build --single gtkhello.d.
   dub gtkhello.d <arguments to hello>.
 */
This is cool. And I even made it work. Again, thanks.
Feb 18 2019
prev sibling parent reply Russel Winder <russel winder.org.uk> writes:
On Sat, 2019-02-16 at 16:28 +0000, Ron Tarrant via Digitalmars-d-learn wrot=
e:
=20
 [=E2=80=A6]
Apologies for the delay in replying.
 It's been almost 20 years since I used Linux and my notes are=20
 long gone. A ton of things have changed. Like, for instance, it=20
 found all my hardware this time, without me getting involved. But=20
 also the software installation managers and lots of other things=20
 are completely unrecognizable. On top of that, my brain has=20
 (unfortunately) been molded into the Windows/Microsoft way of=20
 thinking.
Personally I use aptitude for all Debian package management =E2=80=93 Ubunt= u and Mint are the same as Debian really in this but with different package repositori= es. Some people use apt and some apt-get, etc. For me the advantage of aptitude= is that it has a curses-based GUI as well as command line.
 I guess what I'm hoping for is a step-by-step,=20
 full-on-hand-holding, large-print with pictures tutorial for how=20
 to get GtkD and (I guess) dub working. I know the stuff you wrote=20
 is probably helpful, but I'm not well-enough versed in Linux or=20
 any flavour of UNIX ATM to understand it, pick which option I=20
 should use, and to put these commands in proper order.
|> aptitude search gtkd i A libgtkd-3-0 - GTK+ graphical user interface libr= ary - D bin i A libgtkd-3-dev - GTK+ graphical user interface libr= ary - devel p libgtkd3-67 - gtkd3 for dmd2 (runtime library) =20 p libgtkd3-68 - gtkd3 for dmd2 (runtime library) =20 p libgtkd3-69 - gtkd3 for dmd2 (runtime library) =20 p libgtkd3-70 - gtkd3 for dmd2 (runtime library) =20 p libgtkd3-71 - gtkd3 for dmd2 (runtime library) =20 p libgtkd3-72 - gtkd3 for dmd2 (runtime library) =20 p libgtkd3-73 - gtkd3 for dmd2 (runtime library) =20 p libgtkd3-74 - gtkd3 for dmd2 (runtime library) =20 p libgtkd3-75 - gtkd3 for dmd2 (runtime library) =20 p libgtkd3-76 - gtkd3 for dmd2 (runtime library) =20 p libgtkd3-77 - gtkd3 for dmd2 (runtime library) =20 p libgtkd3-78 - gtkd3 for dmd2 (runtime library) =20 p libgtkd3-79 - GtkD3 for DMD2 (runtime library) =20 p libgtkd3-80 - GtkD3 for DMD2 (runtime library) =20 p libgtkd3-81 - GtkD3 for DMD2 (runtime library) =20 p libgtkd3-82 - GtkD3 for DMD2 (runtime library) =20 p libgtkd3-83 - GtkD3 for DMD2 (runtime library) =20 p libgtkd3-84 - GtkD3 for DMD2 (runtime library) =20 p libgtkd3-dev - GtkD3 for DMD2 (development files) =20 i libgtkd3-doc - GtkD3 for DMD2 (documentation and examples) =20 p libgtkdatabox-dev - Gtk+ library to display large amou= nts of nume p libgtkdatabox-doc - Gtk+ library to display large amou= nts of nume p libgtkdatabox0 - Gtk+ library to display large amou= nts of nume p libgtkdatabox0-glade - Gtk+ library to display large amou= nts of nume p libgtkdatabox0-libglade - Gtk+ library to display large amou= nts of nume p libgtkdsv-3-0 - GTK+ syntax highlighting widget - = D bindings=20 p libgtkdsv-3-dev - GTK+ syntax highlighting widget - development I am using the GtkD package created by the D Debian package people. This is created using LDC rather than DMD. All the other libgtkd3 packages are ones build by Jordi Sayol on D-Apt. If you want to use DMD, it is probably best = to install them. Me, I am an LDC oriented person so am happy with the standard Debian packaged GtkD. The libgtkd-3-0 package contains just the runtime libraries, or library in this case. This being Linux libraries are always shared objects (aka DLLs):
 dpkg -L libgtkd-3-0=20
/. /usr /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libgtkd-3.so.0.8.5 /usr/share /usr/share/doc /usr/share/doc/libgtkd-3-0 /usr/share/doc/libgtkd-3-0/changelog.Debian.gz /usr/share/doc/libgtkd-3-0/changelog.gz /usr/share/doc/libgtkd-3-0/copyright /usr/lib/x86_64-linux-gnu/libgtkd-3.so.0 The libgtkd-3-dev package contains all the files needed to build code against GtkD. |> dpkg -L libgtkd-3-dev /. /usr /usr/include /usr/include/d /usr/include/d/gtkd-3 =E2=80=A6 [all the GtkD sources.] =E2=80=A6 /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/pkgconfig /usr/lib/x86_64-linux-gnu/pkgconfig/gtkd-3.pc /usr/share /usr/share/doc /usr/share/doc/libgtkd-3-dev /usr/share/doc/libgtkd-3-dev/changelog.Debian.gz /usr/share/doc/libgtkd-3-dev/changelog.gz /usr/share/doc/libgtkd-3-dev/copyright /usr/lib/x86_64-linux-gnu/libgtkd-3.so The last file here is crucial since it is the file you link your code again= st to get the version currently on this system. The file: /usr/lib/x86_64-linux-gnu/pkgconfig/gtkd-3.pc is critical since it tells the compiler where to look for stuff. |> more /usr/lib/x86_64-linux-gnu/pkgconfig/gtkd-3.pc Name: GtkD Description: A D binding and OO wrapper for GTK+. Version: 3.8.5 Libs: -L-L/usr/lib/x86_64-linux-gnu/ -L-lgtkd-3 -L-ldl Cflags: -I/usr/include/d/gtkd-3/
 So far, as I said, dmd is working. Up until now, I've avoided dub=20
 because, with so many code examples (more than 70 at present) dub=20
 would bring in a lot of file/directory clutter.
In this situation, I tend to use SCons as a build manager. I also use Meson= , but the /usr/lib/x86_64-linux-gnu/pkgconfig/gtkd-3.pc is, sadly, inconsiste= nt with the way Meson works, so you have to use a bit of a hideous hack to get things working. That is for later not now. So here is a "Hello World in D" project I have: |> tree . =E2=94=9C=E2=94=80=E2=94=80 cmake-d -> /home/users/russel/Repositories/Git/= Forks/CMake-D/cmake-d =E2=94=9C=E2=94=80=E2=94=80 CMakeLists.txt =E2=94=9C=E2=94=80=E2=94=80 dub.sdl =E2=94=9C=E2=94=80=E2=94=80 dub.selections.json =E2=94=9C=E2=94=80=E2=94=80 meson.build =E2=94=9C=E2=94=80=E2=94=80 SConstruct =E2=94=94=E2=94=80=E2=94=80 source =E2=94=9C=E2=94=80=E2=94=80 gtkd_button.d =E2=94=9C=E2=94=80=E2=94=80 gtkd_label.d =E2=94=9C=E2=94=80=E2=94=80 qtd.d =E2=94=9C=E2=94=80=E2=94=80 SConscript =E2=94=94=E2=94=80=E2=94=80 text.d 1 directory, 11 files The CMake-D build is broken, so we have to ignore that. The QtD is a work in progress, that isn't actually progressing.=20 Let me point you at https://bitbucket.org/russel/helloworld/src/default/D/ rather than cut and past the SCons files here. The summary is a SCons file = is a Python script (Python 3.7 in my case) that calculates a build ADG and = then actions any needed changes. The result in this case: |> scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... ldc2 -I=3D. -O -release -I/usr/include/d/gtkd-3/ -c -of=3DBuild_SCons/gtkd_= button.o source/gtkd_button.d ldc2 -of=3DBuild_SCons/gtkd_button -L-L/usr/lib/x86_64-linux-gnu/ Build_SCo= ns/gtkd_button.o -L-lgtkd-3 -L-ldl ldc2 -I=3D. -O -release -I/usr/include/d/gtkd-3/ -c -of=3DBuild_SCons/gtkd_= label.o source/gtkd_label.d ldc2 -of=3DBuild_SCons/gtkd_label -L-L/usr/lib/x86_64-linux-gnu/ Build_SCon= s/gtkd_label.o -L-lgtkd-3 -L-ldl ldc2 -I=3D. -O -release -c -of=3DBuild_SCons/text.o source/text.d ldc2 -of=3DBuild_SCons/text Build_SCons/text.o scons: done building targets. The calls to pkg-config have picked up the needed -L-L and -L-l options in order for it to build. I had thought the Dub build worked, but it doesn't. :-(
 But you're saying that dub will make it easier to keep up with=20
 future changes/updates in all the various bits and bobs, so if=20
 that means I finally have to do dub, perhaps someone could point=20
 me at a good tutorial for that?
Sort of. Using the Debian packages, things get updated when the packagers update things. They are usually pretty quick. Using Dub, you have to bit mo= re hands on given the dependency version in the dub.sdl file.
 Sorry if I sound ungrateful or cranky, but I have a lot on my=20
 plate ATM and I'm getting frustrated.
Hopefully the above has helped, do feel free to ask further questions. I am= a day-in, day-out Debian Sid user and so may still be making assumptions tht aren't working for you=E2=80=A6 --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Road m: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk
Feb 17 2019
parent reply Ron Tarrant <rontarrant gmail.com> writes:
On Monday, 18 February 2019 at 06:29:54 UTC, Russel Winder wrote:

 Hopefully the above has helped, do feel free to ask further 
 questions. I am a day-in, day-out Debian Sid user and so may 
 still be making assumptions tht aren't working for you…
I really appreciate all the time and effort you put into that reply, Russell. That is a ton of info there. I didn't realize how soft (dare I say: micro-soft) Windows had made me over the last decade or so. Coming back to UNIX-like and POSIX OSs, I'm feeling like a complete newbie again. But some day I shall reclaim my Super Cow Powers. :)
Feb 18 2019
parent Ron Tarrant <rontarrant gmail.com> writes:
On Monday, 18 February 2019 at 13:55:41 UTC, Ron Tarrant wrote:

 But some day I shall reclaim my Super Cow Powers. :)
Oh, I guess I misspelled 'seardh.' That may explain why my attempt to run aptitude was 'put out to pasture.'
Feb 18 2019
prev sibling next sibling parent Mike Parker <aldacron gmail.com> writes:
On Saturday, 16 February 2019 at 13:35:57 UTC, Ron Tarrant wrote:

 dmd -de -w -m64 -L+gtkd hello_gtkd_world.d
DMD's -L switch means "pass the following flag to the linker". Linker arguments are system-dependent. The + is what you use on Windows to specify the library path when running DMD with the default 32-bit linker (optlink). On Linux, it's actually -L, so you should be specifying -L-Lgtkd. Assuming, of course, gtkd is the path and not the library name.
Feb 16 2019
prev sibling next sibling parent reply Jordi Sayol <g.sayol gmail.com> writes:
El 16/2/19 a les 14:35, Ron Tarrant via Digitalmars-d-learn ha escrit:
 Hi guys,
 
 I finally got a Linux Mint installation happening (very impressed, BTW) and
did the usual HelloWorld.d compile with dmd, but I'm having trouble working out
how to link to GtkD.
 
 dmd -de -w -m64 -L+gtkd hello_gtkd_world.d
 
 says it can't find MainWindow which tells me the gtkd libraries are not
installed, are not included in the path, or some other oversight on my part.
 
 I tried using whereis to find gtkd, but to no avail.
 
 Questions:
 
 1. Am I using the right syntax in the above command line?
 
 2. How to search for things on Linux Mint
 
 The recommendations I've found so far are for the gnome search tool which
spits out an error:
 
 Package gnome-search-tool is not available, but is referred to by another
package.
 This may mean that the package is missing, has been obsoleted, or
 is only available from another source
 
Hello Ron, There is "d-apt" <https://d-apt.sourceforge.io/> where there are dmd and gtkd deb for Linux Mint. To add this repository to your Linux Mint just run this two lines from command line: $ sudo wget https://netcologne.dl.sourceforge.net/project/d- pt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list $ sudo apt-get update --allow-insecure-repositories && sudo apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring && sudo apt-get update After that you can install all the packages on "d-apt". To install dmd compiler, dmd doc, gtkd devel and gtkd doc packages just run the next line: $ sudo apt-get install dmd-compiler dmd-doc libgtkd3-dev libgtkd3-doc Then you can compile/run a GtkD example contained on gtkd doc archive. To do that just run the next line: $ dmd `pkg-config --cflags --libs gtkd-3` -run /usr/share/libgtkd3-doc/demos/gtkD/TestWindow/*.d -ofTestWindow To run the compiled example just type: $ ./TestWindow There are more examples at /usr/share/libgtkd3-doc/demos/ Hope this help you. Jordi
Feb 17 2019
parent reply Ron Tarrant <rontarrant gmail.com> writes:
On Sunday, 17 February 2019 at 14:19:35 UTC, Jordi Sayol wrote:

 To add this repository to your Linux Mint just run this two 
 lines from command line:
 Jordi
Thanks, Jordi. This is going straight into my notes. You've saved me a ton of time and effort.
Feb 18 2019
parent Ron Tarrant <rontarrant gmail.com> writes:
On Monday, 18 February 2019 at 13:34:22 UTC, Ron Tarrant wrote:
 You've saved me a ton of time and effort.
This can be interpreted as: flailing about, bashing my shell against the terminal.
Feb 18 2019
prev sibling next sibling parent Jordi Sayol <g.sayol gmail.com> writes:
El 17/2/19 a les 15:19, Jordi Sayol ha escrit:
 Then you can compile/run a GtkD example contained on gtkd doc archive. To do
that just run the next line:
 
 $ dmd `pkg-config --cflags --libs gtkd-3` -run
/usr/share/libgtkd3-doc/demos/gtkD/TestWindow/*.d -ofTestWindow
Sorry, do not run at compile time. Just remove "-run" to properly compile the example: $ dmd `pkg-config --cflags --libs gtkd-3` /usr/share/libgtkd3-doc/demos/gtkD/TestWindow/*.d -ofTestWindow
 
 
 To run the compiled example just type:
 
 $ ./TestWindow
Regards, Jordi
Feb 17 2019
prev sibling parent reply Peter Jacobs <peterj mech.uq.edu.au> writes:
On Saturday, 16 February 2019 at 13:35:57 UTC, Ron Tarrant wrote:
 Hi guys,

 I finally got a Linux Mint installation happening (very 
 impressed, BTW) and did the usual HelloWorld.d compile with 
 dmd, but I'm having trouble working out how to link to GtkD.

 dmd -de -w -m64 -L+gtkd hello_gtkd_world.d

 says it can't find MainWindow which tells me the gtkd libraries 
 are not installed, are not included in the path, or some other 
 oversight on my part.

 I tried using whereis to find gtkd, but to no avail.

 Questions:

 1. Am I using the right syntax in the above command line?

 2. How to search for things on Linux Mint

 The recommendations I've found so far are for the gnome search 
 tool which spits out an error:

 Package gnome-search-tool is not available, but is referred to 
 by another package.
 This may mean that the package is missing, has been obsoleted, 
 or
 is only available from another source
Being an old linux user, I prefer make to dub, however, I do use dub to build GtkD and then I just use dmd to build my application program. Here is a transcript of building and running the first tutorial exercise on my computer that runs LinuxMint. It all works nicely, when pointing the DMD compiler to the generated gtkd bindings and the linker to the dub-built library file. peterj helmholtz ~/work/play/dlang/GtkD $ dub clean Cleaning package at /home/peterj/work/play/dlang/GtkD... peterj helmholtz ~/work/play/dlang/GtkD $ dub build Performing "debug" build using /usr/bin/dmd for x86_64. gtk-d:gtkd ~master: building configuration "library"... generated/gtkd/glib/Spawn.d(305,3): Deprecation: foreach: loop index implicitly converted from size_t to int gtk-d:gstreamer ~master: building configuration "library"... gtk-d:peas ~master: building configuration "library"... gtk-d:sv ~master: building configuration "library"... gtk-d:vte ~master: building configuration "library"... peterj helmholtz ~/work/play/dlang/GtkD $ cd ../gtkd-example/ peterj helmholtz ~/work/play/dlang/gtkd-example $ make dmd -w -g -debug -I=../GtkD/generated/gtkd \ -oftest_rig_imperative test_rig_imperative.d \ -L../GtkD/libgtkd-3.a peterj helmholtz ~/work/play/dlang/gtkd-example $ ./test_rig_imperative Hello GtkD Imperative Bye. peterj helmholtz ~/work/play/dlang/gtkd-example $ dmd --version DMD64 D Compiler v2.085.0-beta.1 Copyright (C) 1999-2019 by The D Language Foundation, All Rights Reserved written by Walter Bright
Feb 18 2019
parent reply Ron Tarrant <rontarrant gmail.com> writes:
On Monday, 18 February 2019 at 10:38:10 UTC, Peter Jacobs wrote:

 Being an old linux user, I prefer make to dub, however, I do 
 use dub to build GtkD and then I just use dmd to build my 
 application program.
This appeals to me, too.
 dub clean
 dub build
Got this bit working after generating an sdl file. But I think I'm missing something from this next approach:
 make
 dmd -w -g -debug -I=../GtkD/generated/gtkd \
 	-oftest_rig_imperative test_rig_imperative.d \
 	-L../GtkD/libgtkd-3.a
 ./test_rig_imperative
It's been literally decades since I used a makefile. Did I miss the part where you the makefile was written/generated? I'd also like to take this opportunity to express my deepest gratitude to all you guys for all this help. Getting back up and running in Linux has had its challenges and over the weekend, I admit I almost gave up after just trying to get a desktop sorted out. I won't bore you with off-topic details, but suffice to say, my Focusrite audio interface has a mind of its own. But to wake up this morning to this outpouring of help made me feel tons better about it all. I have a build process [or five :) ] now and all the discouragement of the weekend is draining away. Thanks, guys! Seriously. Thank you.
Feb 18 2019
parent Peter Jacobs <peterj mech.uq.edu.au> writes:
On Monday, 18 February 2019 at 14:24:46 UTC, Ron Tarrant wrote:
 On Monday, 18 February 2019 at 10:38:10 UTC, Peter Jacobs wrote:

 Being an old linux user, I prefer make to dub, however, I do 
 use dub to build GtkD and then I just use dmd to build my 
 application program.
This appeals to me, too.
 dub clean
 dub build
Got this bit working after generating an sdl file. But I think I'm missing something from this next approach:
 make
 dmd -w -g -debug -I=../GtkD/generated/gtkd \
 	-oftest_rig_imperative test_rig_imperative.d \
 	-L../GtkD/libgtkd-3.a
 ./test_rig_imperative
It's been literally decades since I used a makefile. Did I miss the part where you the makefile was written/generated?
Yes, you did miss that part because I didn't write it in, thinking that the echo of the command would be sufficient. Sorry. Anyway, here is the single rule in my makefile. I tend to use makefiles as a memory aid so they are often quite simple. test_rig_imperative: test_rig_imperative.d dmd -w -g -debug -I=../GtkD/generated/gtkd \ -oftest_rig_imperative test_rig_imperative.d \ -L../GtkD/libgtkd-3.a Cheers, Peter J.
Feb 18 2019