On 20-07-17 16:04, Alan Turvey wrote:

I am new to D on linux and I have compiled and run the TestWindow sample. I thought the next step might be to work with the SimpleGL example:

demos/gl/simple/SimpleGL.d

But I have been unable to compile it. This is where I am up to.

[~/d/GtkD-3.6.5/demos/gl/simple]$ dmd SimpleGL.d -L-L~d/GtkD-3.6.5/ -L-lgtkd-3
SimpleGL.d(21): Error: module Event is in file 'gdk/Event.d' which cannot be read
import path[0] = /usr/include/dmd/phobos
import path[1] = /usr/include/dmd/druntime/import

I know an Event object is in the libgtkd-3 library...

[~/d/GtkD-3.6.5]$ ar -t libgtkd-3.a | grep "Event"
EventSequence.o
Event.o
EventController.o
EventBox.o

Could someone add a makefile or let me know how to compile and link this SimpleGL.d file?

You are missing the path the the GtkD source files and the opengl library.

dmd SimpleGL.d -I~d/GtkD-3.6.5/generated/gtkd -L-L~d/GtkD-3.6.5/ 
-L-lgtkd-3 -L-lGL -L-ldl

And if you used make install or installed GtkD with the package
manager of your distribution (if available), you could use pkg-config.

dmd `pkg-config --cflags --libs gtkd-3` -L-lGL