Sign up

Introduction and request for help.

Hey Everyone,

I'm a new D developer and therefore new to Gtkd. By day I'm an android developer using Kotlin and most of my hobby projects are in Go.

So far I've enjoyed my time working in D. I've been working on this project, https://gitlab.com/kendellfab/rest-scope, a rest testing project much like postman.

So far I've had no problems building this project with DUB. However I want to move over to meson so that I can build it for flatpak. I am finding that I am unable to build with meson.

I've had two issues. First, I was unable to find the dependencies wit this, gtkd_dep = dependency('gtk-d:gtkd', version: '~>3.9.0', method: 'dub'). This dep is added to the dependencies array passed to the executable. The build would fail as it could not find the gsv.SourceView.

I was able to fix this issue, by passing in a directory to the dependency array, such as this. declaredependency(includedirectories: packagedir + '/gtk-d-3.9.0/gtk-d/generated/sourceview'). The packagedir string being set by an option with generating the meson build directory, this is to my home folder .dub directory.

But this created a new build issue with the linker. The linker can not find the source view objects to link with the executable. So again my builds are failing. But I'm unsure where to find the object files for the linker to link in.

Does any one have any insights on how I could get this project to build?

Re: Introduction and request for help.

You do not mention which platform you are working on. For me using Debian Sid, GtkD is an installable package and so all I need is:

dependency('gtkd-3', version: '>= 3.9.0')

having installed the package libgtkd-3-dev.

This doesn't perhaps answer your question, but it hopefully starts a conversation that can end with an answer to your question.

Re: Introduction and request for help.

On 10-03-2020 17:57, Russel Winder wrote:

You do not mention which platform you are working on. For me using Debian Sid, GtkD is an installable package and so all I need is:

dependency('gtkd-3', version: '>= 3.9.0')

having installed the package libgtkd-3-dev.

This doesn't perhaps answer your question, but it hopefully starts a conversation that can end with an answer to your question.

It looks like the meson dub integration has issues with sub projects,
since the files and libraries mentioned in the errors aren't part of
gtk-d:gtkd, but part of the other sub projects.

If gtkd is available in the repositories of your that that can be used
as a regular dependency in meason. The same is also true is you install
gtkd manually with make && make install.

Re: Introduction and request for help.

On Tue, 10 Mar 2020 22:15:49 +0100, Mike Wey wrote:

On 10-03-2020 17:57, Russel Winder wrote:

If gtkd is available in the repositories of your that that can be used
as a regular dependency in meason. The same is also true is you install
gtkd manually with make && make install.

Thanks everyone for your feedback. I did forget to mention that I am on Arch Linux for this.

There is gtkd in the repos. I have installed it. And I still get a linker error:

/usr/bin/ld: restscope@exe/sourceviewsappwindow.d.o:(.data.rel.ro+0x140): undefined reference to `D3gsv10SourceView12_ModuleInfoZ'

It seems that the object files aren't being added by the link command. But I'm not familiar enough with meson to track down the details like that yet.

Re: Introduction and request for help.

On Tue, 10 Mar 2020 22:23:28 GMT, Kendell Fab wrote:
[…]

Thanks everyone for your feedback. I did forget to mention that I am on Arch Linux for this.

There is gtkd in the repos. I have installed it. And I still get a linker error:

I am a believer in using the platform packages for GtkD whenever possible. I am guessing Arch will be at least as up to date as Debian Sid.

/usr/bin/ld: restscope@exe/sourceviewsappwindow.d.o:(.data.rel.ro+0x140): undefined reference to `D3gsv10SourceView12_ModuleInfoZ'

It seems that the object files aren't being added by the link command. But I'm not familiar enough with meson to track down the details like that yet.

I have seen this sort of problem when the version of GtkD and D used have been mixed. The usual solution has been to do a complete clean of the build and start from scratch.

I use ldc rather than dmd as the D compiler, ldc is provided as packages in Debian. However it is critically important that GtkD was compiled with the same ldc as being used to build the application.

Re: Introduction and request for help.

In case it helps, my primary D project of the moment is GFontBrowser which has a Meson build for building and installing on Debian Sid.

https://github.com/russel/GFontBrowser

There is also a Dub and a SCons build but the Meson build is the most important for me.

Re: Introduction and request for help.

On 10-03-2020 23:23, Kendell Fab wrote:

On Tue, 10 Mar 2020 22:15:49 +0100, Mike Wey wrote:

On 10-03-2020 17:57, Russel Winder wrote:

If gtkd is available in the repositories of your that that can be used
as a regular dependency in meason. The same is also true is you install
gtkd manually with make && make install.

Thanks everyone for your feedback. I did forget to mention that I am on Arch Linux for this.

There is gtkd in the repos. I have installed it. And I still get a linker error:

/usr/bin/ld: restscope@exe/sourceviewsappwindow.d.o:(.data.rel.ro+0x140): undefined reference to `D3gsv10SourceView12_ModuleInfoZ'

It seems that the object files aren't being added by the link command. But I'm not familiar enough with meson to track down the details like that yet.

I took a closer look at your project, and you are using the SourceView
widget. In that case you will also need to add the sourceview binding as
a dependency.

gtkdsv_dep = dependency('gtkdsv-3', version: '~>3.9.0')

or when using a dub dependency:

gtkdsv_dep = dependency('gtk-d:gtkdsv', version: '~>3.9.0', method: 'dub')

Re: Introduction and request for help.

On Wed, 11 Mar 2020 20:17:59 +0100, Mike Wey wrote:
[…]

I took a closer look at your project, and you are using the SourceView

[…]

Did I miss a link to the project? Well done for finding it and what seems the core cause of the difficulty.

Re: Introduction and request for help.

Thanks everyone for your help. It was a missing dependency specified in my meson.build. I have been able to get it to build now.

Re: Introduction and request for help.

:-)