Hi All!

This weekend I explored Dlang and I think it's very promising. So I wanted to create some projects I've created with C++ already - for the sake of comparison.

I wanted to create a new class which inherits from DrawingArea (from the Gtk library). This will be my OpenGL-Widget with functions like "drawGL", which I have to override.

So I downloaded the "GtkD-3.3.0.zip" from here: http://gtkd.org/download.html and compiled it successfully (with "make all").

Now I've got the libraries gstreamerd-3, gtkd-3, gtkdgl-3, gtkdsv-3 and vted-3. I also got the module files for the import at "/usr/local/include/d/gtkd-3/", after I did a "make install".

Now I tested a little example I found somewhere in the web, which looks like:

import gtk.MainWindow;
import gtk.Label;
import gtk.Main;
import gtk.GLArea;
void main(string[] args)
{
        Main.init(args);
        MainWindow win = new MainWindow("Hello World");
        GLArea area = new GLArea();
        win.add(area);
        win.setDefaultSize(200, 100);
        win.showAll();
        Main.run();
}

This compiles fine and I get an empty black window. (I compiled with the options: "dmd main.d -I/usr/local/include/d/gtkd-3 -L/pathToLib/libgtkd-3.a")



Now I scanned through the demos at the GtkD Library and I found one, that fits my needs perfectly. It is located at ".../GtkD-3.3.0/demos/gl/simple/SimpleGL.d" (I post the source code in an extra answer, since it is a bit lengthy...)

This demo compiles fine (with "dmd main.d -c -I/...", -c tells the compiler not to link). But the linker gives an error here (command was: "dmd main.o -L/libgtkd-3.a -L/libgtkdgl-3.a ...", I linked to all the libs mentioned above). I get a very lengthy error message, and I cant figure out, why the reference to all the gl stuff is missing. Would be really great, if some one could give me a hint!

Ah, yeah, just do avoid the answer "make it with dub!": Actually I did it also with dub and I get the same error messages... If you are interested, I can provide you also my .json file. But I like to know whats going on behind, so I prefer the way to install my libs manually. Would be great, if I get this working.

$ dmd main.o -L/.../GtkD-3.3.0/libgtkd-3.a -L/.../GtkD-3.3.0/libgtkdgl-3.a -L/.../GtkD-3.3.0/libgstreamerd-3.a -L/.../GtkD-3.3.0/libgtkdsv-3.a -L/.../GtkD-3.3.0/libvted-3.a
main.o:
In function `_D8simpleGL8SimpleGL8SimpleGL8__mixin712realizeFrameMFC3gtk6Widget6WidgetZv':
main.d:(.text._D8simpleGL8SimpleGL8SimpleGL8__mixin712realizeFrameMFC3gtk6Widget6WidgetZv+0xcf):
 undefined reference to `glFlush'
main.o: In function `_D8simpleGL8SimpleGL8SimpleGL8__mixin79drawFrameMFC5cairo7Context7ContextC3gtk6Widget6WidgetZb':
main.d:(.text._D8simpleGL8SimpleGL8SimpleGL8__mixin79drawFrameMFC5cairo7Context7ContextC3gtk6Widget6WidgetZb+0xc0):
 undefined reference to `glFlush'
main.o: In function `_D8simpleGL8SimpleGL8SimpleGL8__mixin714configureFrameMFC3gdk5Event5EventC3gtk6Widget6WidgetZb':
main.d:(.text._D8simpleGL8SimpleGL8SimpleGL8__mixin714configureFrameMFC3gdk5Event5EventC3gtk6Widget6WidgetZb+0x11a):
 undefined reference to `glFlush'
main.o: In function `_D8simpleGL8SimpleGL8SimpleGL8__mixin78mapFrameMFC3gtk6Widget6WidgetZv':
main.d:(.text._D8simpleGL8SimpleGL8SimpleGL8__mixin78mapFrameMFC3gtk6Widget6WidgetZv+0xbb):
 undefined reference to `glFlush'
main.o: In function `_D8simpleGL8SimpleGL8SimpleGL8__mixin710unmapFrameMFC3gtk6Widget6WidgetZv':
main.d:(.text._D8simpleGL8SimpleGL8SimpleGL8__mixin710unmapFrameMFC3gtk6Widget6WidgetZv+0xbb):
 undefined reference to `glFlush'
main.o:main.d:(.text._D8simpleGL8SimpleGL8SimpleGL8__mixin715visibilityFrameMFC3gdk5Event5EventC3gtk6Widget6WidgetZb+0xc8):
 more undefined references to `glFlush' follow
main.o: In function `_D8simpleGL8SimpleGL8SimpleGL6drawGLMFZb':
main.d:(.text._D8simpleGL8SimpleGL8SimpleGL6drawGLMFZb+0x45): undefined reference to `glClear' main.d:(.text._D8simpleGL8SimpleGL8SimpleGL6drawGLMFZb+0x4a): undefined reference to `glLoadIdentity' main.d:(.text._D8simpleGL8SimpleGL8SimpleGL6drawGLMFZb+0xa9): undefined reference to `gluLookAt' main.d:(.text._D8simpleGL8SimpleGL8SimpleGL6drawGLMFZb+0xb7): undefined reference to `glBegin' main.d:(.text._D8simpleGL8SimpleGL8SimpleGL6drawGLMFZb+0xdb): undefined reference to `glColor3f' main.d:(.text._D8simpleGL8SimpleGL8SimpleGL6drawGLMFZb+0xff): undefined reference to `glVertex3f' main.d:(.text._D8simpleGL8SimpleGL8SimpleGL6drawGLMFZb+0x123): undefined reference to `glColor3f' main.d:(.text._D8simpleGL8SimpleGL8SimpleGL6drawGLMFZb+0x142): undefined reference to `glVertex3f' main.d:(.text._D8simpleGL8SimpleGL8SimpleGL6drawGLMFZb+0x166): undefined reference to `glColor3f' main.d:(.text._D8simpleGL8SimpleGL8SimpleGL6drawGLMFZb+0x18a): undefined reference to `glVertex3f' main.d:(.text._D8simpleGL8SimpleGL8SimpleGL6drawGLMFZb+0x18f): undefined reference to `glEnd' main.o: In function `_D8simpleGL8SimpleGL8SimpleGL8resizeGLMFC3gdk5Event5EventZb':
main.d:(.text._D8simpleGL8SimpleGL8SimpleGL8resizeGLMFC3gdk5Event5EventZb+0x112):
 undefined reference to `glViewport'
main.d:(.text._D8simpleGL8SimpleGL8SimpleGL8resizeGLMFC3gdk5Event5EventZb+0x11c):
 undefined reference to `glMatrixMode'
main.d:(.text._D8simpleGL8SimpleGL8SimpleGL8resizeGLMFC3gdk5Event5EventZb+0x121):
 undefined reference to `glLoadIdentity'
main.d:(.text._D8simpleGL8SimpleGL8SimpleGL8resizeGLMFC3gdk5Event5EventZb+0x153):
 undefined reference to `gluPerspective'
main.d:(.text._D8simpleGL8SimpleGL8SimpleGL8resizeGLMFC3gdk5Event5EventZb+0x15d):
 undefined reference to `glMatrixMode'
collect2: error: ld returned 1 exit status
--- errorlevel 1


Reply via email to