Sign up

Sample gtkD application not compiling.

The sample gtkD application (gtk-demo) does not want to compile, no matter what I try, I always get an error. However, when I just run it with dub, it works fine, so I'm assuming a dependency is missing, although I have not been able to figure out which one it is. Any help would be greatly appreciated.

The error I get when I try to compile:
Error: module 'MainWindow' is in the file 'gtk/MainWindow.d' which cannot be read
import path[0] = /usr/include/d
import path[1] = /usr/include/d/druntime/import

Re: Sample gtkD application not compiling.

Also forgot to mention, I am on Void Linux, if that makes a difference.

Re: Sample gtkD application not compiling.

On 21-04-2022 10:52, aarc wrote:

The sample gtkD application (gtk-demo) does not want to compile, no matter what I try, I always get an error. However, when I just run it with dub, it works fine, so I'm assuming a dependency is missing, although I have not been able to figure out which one it is. Any help would be greatly appreciated.

The error I get when I try to compile:
Error: module 'MainWindow' is in the file 'gtk/MainWindow.d' which cannot be read
import path[0] = /usr/include/d
import path[1] = /usr/include/d/druntime/import

You will need to include the source directory of GtkD in your dmd
commandline.

dmd source.d -I path/to/gtkD -L-Lpath/to/libgtkD -L-lgtkd-3 -L-ldl

If gtkD is installed on your system with make install or from the
package manager. you can use:

pkg-config --cflags --libs gtkd-3

To get the compiler flags needed to compile a gtkD application.

Re: Sample gtkD application not compiling.

Thanks!

Re: Sample gtkD application not compiling.

Hi all,
I compiled the sample application with:

dmd mygtkdhello_window.d -I/usr/include/d/gtkd-3 -L-lgtkd-3 -L-ldl

but when I try to run it on Linux (FossaDog Ubuntu 20.04 based):

./mygtkdhello_window

I get a Segmentation fault error.

GTK+ is installed and working fine (with both Glade and GTK# programs)

Please, what am I missing or doing wrong?

Re: Sample gtkD application not compiling.

On Thu, 14 Jul 2022 15:56:52 GMT, marfalk wrote:

Hi all,
I compiled the sample application with:

dmd mygtkdhello_window.d -I/usr/include/d/gtkd-3 -L-lgtkd-3 -L-ldl

but when I try to run it on Linux (FossaDog Ubuntu 20.04 based):

./mygtkdhello_window

I get a Segmentation fault error.

GTK+ is installed and working fine (with both Glade and GTK# programs)

Please, what am I missing or doing wrong?

A good idea is to run it in a GDB session (gdb ./mygtkdhello_window) and see what is going on.