www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - does GtkD (win7) support opengl?

reply Alexandr Druzhinin <drug2004 bk.ru> writes:
I built GtkD following instructions from 
https://github.com/gtkd-developers/GtkD/wiki/Installing-on-Windows. Then 
I tried to build demo from demos/gl/simple/simplegl.d and failed with 
undefined symbols http://dpaste.dzfl.pl/ba0c3277
Script (dgen.d) builds the whole library and there is no separate lib to 
provide opengl (sort of gtkdgl.lib) so where can I find these undefined 
symbols to satisfy compiler?
Apr 01 2013
next sibling parent reply "Jesse Phillips" <Jessekphillips+D gmail.com> writes:
On Monday, 1 April 2013 at 14:58:36 UTC, Alexandr Druzhinin wrote:
 I built GtkD following instructions from 
 https://github.com/gtkd-developers/GtkD/wiki/Installing-on-Windows. 
 Then I tried to build demo from demos/gl/simple/simplegl.d and 
 failed with undefined symbols http://dpaste.dzfl.pl/ba0c3277
 Script (dgen.d) builds the whole library and there is no 
 separate lib to provide opengl (sort of gtkdgl.lib) so where 
 can I find these undefined symbols to satisfy compiler?
Please provide your compile command, it looks like you didn't tell the linker where to find GtkD.
Apr 01 2013
parent reply Alexandr Druzhinin <drug2004 bk.ru> writes:
02.04.2013 1:32, Jesse Phillips пишет:
 Please provide your compile command, it looks like you didn't tell the
 linker where to find GtkD.
cd path/to/GtkD/demos/gl/simple dmd SimpleGL.d -I../../../src -I../../../srcgl ../../../src/GtkD.lib without GtkD.lib there are much more undefined symbols
Apr 01 2013
parent reply "Jesse Phillips" <Jessekphillips+d gmail.com> writes:
On Tuesday, 2 April 2013 at 06:19:23 UTC, Alexandr Druzhinin 
wrote:
 02.04.2013 1:32, Jesse Phillips пишет:
 Please provide your compile command, it looks like you didn't 
 tell the
 linker where to find GtkD.
cd path/to/GtkD/demos/gl/simple dmd SimpleGL.d -I../../../src -I../../../srcgl ../../../src/GtkD.lib without GtkD.lib there are much more undefined symbols
Ops I was thinking Derelict, I don't think GtkD is dynamically linked, so you'll also need to say where gtk is.
Apr 02 2013
parent reply Alexandr Druzhinin <drug2004 bk.ru> writes:
02.04.2013 21:38, Jesse Phillips пишет:
 On Tuesday, 2 April 2013 at 06:19:23 UTC, Alexandr Druzhinin wrote:
 02.04.2013 1:32, Jesse Phillips пишет:
 Please provide your compile command, it looks like you didn't tell the
 linker where to find GtkD.
cd path/to/GtkD/demos/gl/simple dmd SimpleGL.d -I../../../src -I../../../srcgl ../../../src/GtkD.lib without GtkD.lib there are much more undefined symbols
Ops I was thinking Derelict, I don't think GtkD is dynamically linked, so you'll also need to say where gtk is.
but this is compilation error, not runtime or you mean there is another lib I should link against?
Apr 02 2013
parent reply "Jesse Phillips" <Jessekphillips+D gmail.com> writes:
On Tuesday, 2 April 2013 at 16:35:07 UTC, Alexandr Druzhinin 
wrote:
 02.04.2013 21:38, Jesse Phillips пишет:
 On Tuesday, 2 April 2013 at 06:19:23 UTC, Alexandr Druzhinin 
 wrote:
 02.04.2013 1:32, Jesse Phillips пишет:
 Please provide your compile command, it looks like you 
 didn't tell the
 linker where to find GtkD.
cd path/to/GtkD/demos/gl/simple dmd SimpleGL.d -I../../../src -I../../../srcgl ../../../src/GtkD.lib without GtkD.lib there are much more undefined symbols
Ops I was thinking Derelict, I don't think GtkD is dynamically linked, so you'll also need to say where gtk is.
but this is compilation error, not runtime or you mean there is another lib I should link against?
GtkD is only bindings for the actual GTK library, that library must be installed to use GtkD. GtkD being using static linking (at compile time) you need to tell the linker you want the GTK library too. The best way to do this I don't know. The website suggest dgen to build programs after install: https://github.com/gtkd-developers/GtkD/wiki/Installing-on-Windows If you were in Linux you likely would only add -L-lgtk to the compiler command.
Apr 02 2013
parent Alexandr Druzhinin <drug2004 bk.ru> writes:
03.04.2013 1:08, Jesse Phillips пишет:
 GtkD is only bindings for the actual GTK library, that library must be
 installed to use GtkD. GtkD being using static linking (at compile time)
 you need to tell the linker you want the GTK library too.

 The best way to do this I don't know. The website suggest dgen to build
 programs after install:
 https://github.com/gtkd-developers/GtkD/wiki/Installing-on-Windows

 If you were in Linux you likely would only add -L-lgtk to the compiler
 command.
I'm totally agree that I need Gtk runtime - I install it before and set path to it properly. I build GtkD using dgen.d and link against it. But nevertheless I have undefined symbols and I don't know where to find them. Gtk application without opengl support builds very well, but opengl demo building fails.
Apr 02 2013
prev sibling parent reply Mike Wey <mike-wey example.com> writes:
On 04/01/2013 04:58 PM, Alexandr Druzhinin wrote:
 I built GtkD following instructions from
 https://github.com/gtkd-developers/GtkD/wiki/Installing-on-Windows. Then
 I tried to build demo from demos/gl/simple/simplegl.d and failed with
 undefined symbols http://dpaste.dzfl.pl/ba0c3277
 Script (dgen.d) builds the whole library and there is no separate lib to
 provide opengl (sort of gtkdgl.lib) so where can I find these undefined
 symbols to satisfy compiler?
GtkD relies on gtkglext-3 for it's openGL support it can be found here: https://github.com/tdz/gtkglext It currently isn't included in the Gtk-runtime installer, and as far as i know there aren't any binaries readily available for windows. And i haven't yet found the time to try and build it myself. -- Mike Wey
Apr 02 2013
next sibling parent reply Alexandr Druzhinin <drug2004 bk.ru> writes:
03.04.2013 4:13, Mike Wey пишет:
 GtkD relies on gtkglext-3 for it's openGL support it can be found here:
 https://github.com/tdz/gtkglext

 It currently isn't included in the Gtk-runtime installer, and as far as
 i know there aren't any binaries readily available for windows.

 And i haven't yet found the time to try and build it myself.
So undefined symbols may be just unported to windows part of gtkd library?
Apr 02 2013
parent Mike Wey <mike-wey example.com> writes:
On 04/03/2013 03:23 AM, Alexandr Druzhinin wrote:
 03.04.2013 4:13, Mike Wey пишет:
 GtkD relies on gtkglext-3 for it's openGL support it can be found here:
 https://github.com/tdz/gtkglext

 It currently isn't included in the Gtk-runtime installer, and as far as
 i know there aren't any binaries readily available for windows.

 And i haven't yet found the time to try and build it myself.
So undefined symbols may be just unported to windows part of gtkd library?
I didn't even check those. There seem to be missing symbols from OpenGl, for these you could link directly with the openGL library, or use Derelict for these. The others are form the GtkD binding of gtkdgl, these are not compiled by default when building GtkD using the dgen tool from the wiki. -- Mike Wey
Apr 03 2013
prev sibling parent reply Mike Wey <mike-wey example.com> writes:
On 04/02/2013 11:13 PM, Mike Wey wrote:
 On 04/01/2013 04:58 PM, Alexandr Druzhinin wrote:
 I built GtkD following instructions from
 https://github.com/gtkd-developers/GtkD/wiki/Installing-on-Windows. Then
 I tried to build demo from demos/gl/simple/simplegl.d and failed with
 undefined symbols http://dpaste.dzfl.pl/ba0c3277
 Script (dgen.d) builds the whole library and there is no separate lib to
 provide opengl (sort of gtkdgl.lib) so where can I find these undefined
 symbols to satisfy compiler?
GtkD relies on gtkglext-3 for it's openGL support it can be found here: https://github.com/tdz/gtkglext It currently isn't included in the Gtk-runtime installer, and as far as i know there aren't any binaries readily available for windows. And i haven't yet found the time to try and build it myself.
I was able to build gtkglext3 on windows, and i've uploaded a zip file containing the dll's. http://gtkd.org/Downloads/GtkDGL.zip I've also included the static libs for GtkDGL and for 32bits windows two import libraries for opengl and glu, for win64 these are included in the Windows SDK. -- Mike Wey
Apr 09 2013
parent reply Alexandr Druzhinin <drug2004 bk.ru> writes:
10.04.2013 3:48, Mike Wey пишет:
 I was able to build gtkglext3 on windows, and i've uploaded a zip file
 containing the dll's.

 http://gtkd.org/Downloads/GtkDGL.zip

 I've also included the static libs for GtkDGL and for 32bits windows two
 import libraries for opengl and glu, for win64 these are included in the
 Windows SDK.
Thank you very much, Mike! now I have a little time to try gtk again and your help lets me build my SimpleGL demo. But I was forced use my own version of GtkDGL - your' doesn't work. I built it simple just running this from srcgl folder: cd glgdk dmd -lib -ofGlGdk.lib GLConfig.d GLContext.d GLdInit.d GLDrawable.d GLDrawableIF.d GLDrawableT.d GLQuery.d GLWindow.d -I.. -I..\..\src cd .. cd glgtk dmd -lib -ofGlGtk.lib GLCapability.d GLtInit.d GLWidget.d -I.. -I..\..\src cd .. cd gtkglc dmd -lib -ofGtkGlc.lib gl.d glgdk.d glgdktypes.d glgtk.d glgtktypes.d glu.d -I.. -I..\..\src cd .. it created three other libs and these I linked against. Also I was forced to rename: libgdkglext-3.0-0.dll to libgdkglext-win32-3.0-0.dll libgtkglext-3.0-0.dll to libgtkglext-win32-3.0-0.dll Now simplegl building and running but failed with the following: (SimpleGL.exe:4668): GLib-GObject-WARNING **: cannot register existing type `GdkGLConfig' (SimpleGL.exe:4668): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed (SimpleGL.exe:4668): GtkGLExt-CRITICAL **: gtk_widget_set_gl_capability: assertion `GDK_IS_GL_CONFIG (glconfig)' failed object.Error: Access Violation ---------------- 0x0059ADDC 0x0059AC67 0x77B1B459 in LdrRemoveLoadAsDataTable 0x77B1B42B in LdrRemoveLoadAsDataTable 0x77AD0133 in KiUserExceptionDispatcher 0x004E5E73 0x665228B6 in gtk_main_do_event 0x6860BBCC in g_slice_free1 0x63A45E36 in g_closure_invoke 0x77AEE0F2 in RtlAllocateHeap ---------------- I think it relevant to Gtk, not GtkD, but it would be very nice if you could help with it too. Google says nothing about it and simplegl.d has only 150 lines, where should I look for 4668th line?
Apr 23 2013
parent reply Mike Wey <mike-wey example.com> writes:
On 04/23/2013 10:59 AM, Alexandr Druzhinin wrote:
 10.04.2013 3:48, Mike Wey пишет:
 I was able to build gtkglext3 on windows, and i've uploaded a zip file
 containing the dll's.

 http://gtkd.org/Downloads/GtkDGL.zip

 I've also included the static libs for GtkDGL and for 32bits windows two
 import libraries for opengl and glu, for win64 these are included in the
 Windows SDK.
Thank you very much, Mike! now I have a little time to try gtk again and your help lets me build my SimpleGL demo. But I was forced use my own version of GtkDGL - your' doesn't work. I built it simple just running this from srcgl folder: cd glgdk dmd -lib -ofGlGdk.lib GLConfig.d GLContext.d GLdInit.d GLDrawable.d GLDrawableIF.d GLDrawableT.d GLQuery.d GLWindow.d -I.. -I..\..\src cd .. cd glgtk dmd -lib -ofGlGtk.lib GLCapability.d GLtInit.d GLWidget.d -I.. -I..\..\src cd .. cd gtkglc dmd -lib -ofGtkGlc.lib gl.d glgdk.d glgdktypes.d glgtk.d glgtktypes.d glu.d -I.. -I..\..\src cd ..
I probably used a different version of dmd to create the libs.
 it created three other libs and these I linked against.
 Also I was forced to rename:
 libgdkglext-3.0-0.dll to libgdkglext-win32-3.0-0.dll
 libgtkglext-3.0-0.dll to libgtkglext-win32-3.0-0.dll
This is a bug already fixed in git, has got the dll names wrong.
 Now simplegl building and running but failed with the following:

 (SimpleGL.exe:4668): GLib-GObject-WARNING **: cannot register existing
 type `GdkGLConfig'

 (SimpleGL.exe:4668): GLib-CRITICAL **: g_once_init_leave: assertion
 `result != 0' failed

 (SimpleGL.exe:4668): GtkGLExt-CRITICAL **: gtk_widget_set_gl_capability:
 assertion `GDK_IS_GL_CONFIG (glconfig)' failed
 object.Error: Access Violation
 ----------------
 0x0059ADDC
 0x0059AC67
 0x77B1B459 in LdrRemoveLoadAsDataTable
 0x77B1B42B in LdrRemoveLoadAsDataTable
 0x77AD0133 in KiUserExceptionDispatcher
 0x004E5E73
 0x665228B6 in gtk_main_do_event
 0x6860BBCC in g_slice_free1
 0x63A45E36 in g_closure_invoke
 0x77AEE0F2 in RtlAllocateHeap
 ----------------
 I think it relevant to Gtk, not GtkD, but it would be very nice if you
 could help with it too. Google says nothing about it and simplegl.d has
 only 150 lines, where should I look for 4668th line?
I don't think it's the line number. I think i may have this error on my machine once, but not since then. And i can't reproduce it. -- Mike Wey
Apr 23 2013
parent reply Alexandr Druzhinin <drug2004 bk.ru> writes:
24.04.2013 4:02, Mike Wey пишет:
 I don't think it's the line number. I think i may have this error on my
 machine once, but not since then. And i can't reproduce it.
Could I ask you to build SimpleGL demo, check it works and send binary to me? It can help me in solving my trouble. Thank in advance.
Apr 25 2013
parent reply Mike Wey <mike-wey example.com> writes:
On 04/25/2013 02:09 PM, Alexandr Druzhinin wrote:
 24.04.2013 4:02, Mike Wey пишет:
 I don't think it's the line number. I think i may have this error on my
 machine once, but not since then. And i can't reproduce it.
Could I ask you to build SimpleGL demo, check it works and send binary to me? It can help me in solving my trouble. Thank in advance.
http://gtkd.org/Downloads/SimpleGL.zip After updating dmd the demo no longer draws the triangle, i still need to figure out why. -- Mike Wey
Apr 25 2013
parent reply Alexandr Druzhinin <drug2004 bk.ru> writes:
26.04.2013 3:45, Mike Wey пишет:
 http://gtkd.org/Downloads/SimpleGL.zip

 After updating dmd the demo no longer draws the triangle, i still need
 to figure out why.
Link is broken
Apr 25 2013
parent reply Mike Wey <mike-wey example.com> writes:
On 04/26/2013 05:16 AM, Alexandr Druzhinin wrote:
 26.04.2013 3:45, Mike Wey пишет:
 http://gtkd.org/Downloads/SimpleGL.zip

 After updating dmd the demo no longer draws the triangle, i still need
 to figure out why.
Link is broken
Should be working now. -- Mike Wey
Apr 26 2013
next sibling parent Alexandr Druzhinin <drug2004 bk.ru> writes:
27.04.2013 0:57, Mike Wey пишет:
 Should be working now.
Yes, 32bit binary works well (didn't run 64bit). Thank you very much!
Apr 27 2013
prev sibling parent reply Alexandr Druzhinin <drug2004 bk.ru> writes:
developers version of GtkD solves my problem. but GtkD 2.1.1 from 
download page doesn't. May be remove it from there to avoid such problems?
Apr 28 2013
parent reply Mike Wey <mike-wey example.com> writes:
On 04/28/2013 01:04 PM, Alexandr Druzhinin wrote:
 developers version of GtkD solves my problem. but GtkD 2.1.1 from
 download page doesn't. May be remove it from there to avoid such problems?
Does it also draw the triangle properly for you? -- Mike Wey
Apr 28 2013
parent reply Alexandr Druzhinin <drug2004 bk.ru> writes:
28.04.2013 20:26, Mike Wey пишет:
 On 04/28/2013 01:04 PM, Alexandr Druzhinin wrote:
 developers version of GtkD solves my problem. but GtkD 2.1.1 from
 download page doesn't. May be remove it from there to avoid such
 problems?
Does it also draw the triangle properly for you?
yes, it works out of box as expected. Exception is that after window resizing drawGL() function isn't called and I need to call it explicitly in resize() - don't know is it intended or it is some failure.
Apr 28 2013
parent reply Mike Wey <mike-wey example.com> writes:
On 04/28/2013 04:08 PM, Alexandr Druzhinin wrote:
 28.04.2013 20:26, Mike Wey пишет:
 On 04/28/2013 01:04 PM, Alexandr Druzhinin wrote:
 developers version of GtkD solves my problem. but GtkD 2.1.1 from
 download page doesn't. May be remove it from there to avoid such
 problems?
Does it also draw the triangle properly for you?
yes, it works out of box as expected. Exception is that after window resizing drawGL() function isn't called and I need to call it explicitly in resize() - don't know is it intended or it is some failure.
I think it's a bug. -- Mike Wey
Apr 28 2013
parent Mike Wey <mike-wey example.com> writes:
On 04/28/2013 07:33 PM, Mike Wey wrote:
 On 04/28/2013 04:08 PM, Alexandr Druzhinin wrote:
 28.04.2013 20:26, Mike Wey пишет:
 On 04/28/2013 01:04 PM, Alexandr Druzhinin wrote:
 developers version of GtkD solves my problem. but GtkD 2.1.1 from
 download page doesn't. May be remove it from there to avoid such
 problems?
Does it also draw the triangle properly for you?
yes, it works out of box as expected. Exception is that after window resizing drawGL() function isn't called and I need to call it explicitly in resize() - don't know is it intended or it is some failure.
I think it's a bug.
Fixed: https://github.com/gtkd-developers/GtkD/commit/0e41f654a3e24f82d278b4e89581d1a7b9ae2112 -- Mike Wey
Apr 28 2013