FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

gtkDgl Compile problem

 
Post new topic   Reply to topic     Forum Index -> gtkD
View previous topic :: View next topic  
Author Message
SuicidJky



Joined: 10 Dec 2007
Posts: 6

PostPosted: Tue Dec 11, 2007 1:23 pm    Post subject: gtkDgl Compile problem Reply with quote

When I go to compile gtkgl with dsss I get this error:

Code:
srcgl\gtkglc\gl.d(1192): found 'ref' when expecting ')'
srcgl\gtkglc\gl.d(1192): semicolon expected following function declaration
srcgl\gtkglc\gl.d(1626): found 'ref' when expecting ')'
srcgl\gtkglc\gl.d(1626): semicolon expected following function declaration


and when I try with compd I get this one:

Code:
srcgl\glgdk\GLConfig.d(62): module glgdktypes cannot read file 'gtkglc\glgdktypes.d'


I have tried using preview5 and the latest svn revision with the same results, is there something I am missing here?
Back to top
View user's profile Send private message
ShprotX



Joined: 28 Aug 2007
Posts: 24
Location: Ukraine

PostPosted: Tue Dec 11, 2007 1:44 pm    Post subject: Reply with quote

http://www.dsource.org/forums/viewtopic.php?p=17796#17796
Back to top
View user's profile Send private message
SuicidJky



Joined: 10 Dec 2007
Posts: 6

PostPosted: Tue Dec 11, 2007 6:48 pm    Post subject: Reply with quote

Thanks, git is kind of a pain on windows though, but i got it compiled and get symbol errors, I'm guessing this is a problem with my setup though. It's nice to see the dsss conf's in there etc.
Back to top
View user's profile Send private message
SuicidJky



Joined: 10 Dec 2007
Posts: 6

PostPosted: Wed Dec 12, 2007 10:36 am    Post subject: Reply with quote

I am getting these errors with SimpleGL.d does anyone know why?
Code:
SimpleGL.obj(SimpleGL)
 Error 42: Symbol Undefined _glFlush
SimpleGL.obj(SimpleGL)
 Error 42: Symbol Undefined _glClear
SimpleGL.obj(SimpleGL)
 Error 42: Symbol Undefined _glLoadIdentity
SimpleGL.obj(SimpleGL)
 Error 42: Symbol Undefined _gluLookAt
SimpleGL.obj(SimpleGL)
 Error 42: Symbol Undefined _glBegin
SimpleGL.obj(SimpleGL)
 Error 42: Symbol Undefined _glColor3f
SimpleGL.obj(SimpleGL)
 Error 42: Symbol Undefined _glVertex3f
SimpleGL.obj(SimpleGL)
 Error 42: Symbol Undefined _glEnd
SimpleGL.obj(SimpleGL)
 Error 42: Symbol Undefined _glViewport
SimpleGL.obj(SimpleGL)
 Error 42: Symbol Undefined _glMatrixMode
SimpleGL.obj(SimpleGL)
 Error 42: Symbol Undefined _gluPerspective
Back to top
View user's profile Send private message
Auria



Joined: 29 May 2006
Posts: 44

PostPosted: Wed Dec 12, 2007 12:02 pm    Post subject: Reply with quote

Seems like you need to link against OpenGL.
Back to top
View user's profile Send private message
SuicidJky



Joined: 10 Dec 2007
Posts: 6

PostPosted: Wed Dec 12, 2007 2:31 pm    Post subject: Reply with quote

Code:
C:\d\duitest>dmd SimpleGL.d -IC:\gtkD-pre6\gtkD\src -IC:\gtkD-pre6\gtkD\srcgl -L+C:\dmd\lib\+phobos+advapi32+gtkd+gtkdgl


is the code I am using to link it, the libs are in the right spot because gdkd apps seem to compile fine.
Back to top
View user's profile Send private message
kaarna



Joined: 03 Apr 2006
Posts: 92
Location: Finland

PostPosted: Thu Feb 05, 2009 5:52 pm    Post subject: extern(System) Reply with quote

So, finally I had the time to spend the whole evening looking this thing up on the internet. I finally ended up with this D newsgroup thread by Ant: http://www.digitalmars.com/d/archives/digitalmars/D/12896.html

It is a discussion about getting DUI (now called GtkD or gtkD?) to compile it's opengl examples on windows with gtkglext.

The problem was that OpenGL on windows needs Windows linkage, and not C linkage... or something like that. Every OpenGL prototype in D has to be defined as extern(Windows) instead of extern(C).

There's only two extern(C)s that will have to be changed in gtkDgl. /srcgl/gtkglc/gl.d approx. line 1176. And /srcgl/gtkglc/glu.d approx. line 293.

But. The solution that was provided on that newsgroup thread didn't work anymore, because it involved abusing the version statement. So after a long while going through these webpages (listed here to illustrate the pain that is involved when reading out-of-date information):
http://dblog.aldacron.net/2007/07/03/derelict-problems-with-dmd-1018/
http://dblog.aldacron.net/2007/07/08/ooops-thats-not-a-feature/
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=55391
and finally http://dblog.aldacron.net/2007/07/23/dmd-1019-and-2003/

And there it was - the solution. extern(System). Finally the gtkDgl library works on Windows too. I'll try to see if I can commit from this Windows machine...
Back to top
View user's profile Send private message AIM Address MSN Messenger
kaarna



Joined: 03 Apr 2006
Posts: 92
Location: Finland

PostPosted: Thu Feb 05, 2009 6:22 pm    Post subject: Reply with quote

And now it's committed.

I couldn't find a place where this fix should go in the wrapper, so either such place should be found, or then we'll have to apply this everytime we wrap srcgl.

(By the way, gtkglext (the C version) still doesn't work with the native quartz OS X GTK+ framework, so you'll have to use X11 if you want OpenGL on Mac OS X. I'll test if X11 works on OS X, later, using Macports.)
Back to top
View user's profile Send private message AIM Address MSN Messenger
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Fri Feb 06, 2009 1:42 pm    Post subject: Reply with quote

kaarna wrote:
And now it's committed.

I couldn't find a place where this fix should go in the wrapper, so either such place should be found, or then we'll have to apply this everytime we wrap srcgl.


Those two files are not generated by the wrapper, maybe it's commented out but i wouldn't know where.
Back to top
View user's profile Send private message
eldar



Joined: 14 Jun 2008
Posts: 101
Location: Ufa, Russia

PostPosted: Sat Feb 07, 2009 11:06 pm    Post subject: Reply with quote

when I used gtkD, opengl worked fine on Windows for me with Derelict.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> gtkD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group