Closed Ace17 closed 9 years ago
For me the demo only compiles and links when i remove the export
from the function definitions in glcore.d
Here's how I compiled it:
$ gdc CoreGL.d `pkg-config gtkd-3 gl --cflags --libs` -o demo.exe && ./demo.exe
Indeed, I got link errors with rdmd:
$ rdmd `pkg-config gtkd-3 --cflags` -L-lGL -L-ldl CoreGL.d
/tmp/.rdmd-1000/rdmd-CoreGL.d-34137C8B6C6C2BA1758446FBCEC175AF/objs/CoreGL.o: In function `_D6coreGL6CoreGL6CoreGL9unrealizeMFC3gtk6Widget6WidgetZv':
/usr/local/include/d/gtkd-3/gdkpixbuf/Pixbuf.d:(.text._D6coreGL6CoreGL6CoreGL9unrealizeMFC3gtk6Widget6WidgetZv+0x69): undefined reference to `_imp__glDeleteBuffers'
/usr/local/include/d/gtkd-3/gdkpixbuf/Pixbuf.d:(.text._D6coreGL6CoreGL6CoreGL9unrealizeMFC3gtk6Widget6WidgetZv+0x7a): undefined reference to `_imp__glDeleteProgram'
/tmp/.rdmd-1000/rdmd-CoreGL.d-34137C8B6C6C2BA1758446FBCEC175AF/objs/CoreGL.o: In function `_D6coreGL6CoreGL6CoreGL6renderMFC3gdk9GLContext9GLContextC3gtk6GLArea6GLAreaZb'
DMD issue https://issues.dlang.org/show_bug.cgi?id=922.
OK, I removed the 'export' keywords. Now you can run the demo like this:
$ rdmd `pkg-config gtkd-3 --cflags` -L-lGL -L-ldl CoreGL.d
Here's a GtkD with "modern" OpenGL standalone demo. It's a D-simplified translation of the C++ example in gtkmm (seems like the 'simple' OpenGL demo using glBegin/glEnd is obsolete). I had to add a glcore.d import file. Maybe this file would fit better in gtkcgl ?