View previous topic :: View next topic |
Author |
Message |
Digited
Joined: 30 Oct 2007 Posts: 19
|
Posted: Mon Mar 17, 2008 9:22 am Post subject: [CLOSED] X11 & OpenGL: example needed |
|
|
Does anyone use X11 bindings and OpenGL under linux? I'm trying to compile some basic code, but get lots of errors with unions in module X11.Xlib like this:
hellolinux.d.text._Dmain+0x65): undefined reference to `_D3X114Xlib3_N36__initZ'
N36 is XMapEvent, that I don't declare or use myself... Same errors, when I try to declare a XEvent and use it in XNextEvent.
Can someone give source with X11 window (better if opengl) setup?
I don't want to use frameworks like SDL. I use DMD 1.028 and tango Frank.
Last edited by Digited on Thu Mar 20, 2008 1:12 pm; edited 1 time in total |
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Mon Mar 17, 2008 10:38 am Post subject: |
|
|
If you do not want to use a framework like SDL, at least you could look at the source code of SDL, GLFW, or another framework to determine how they set up a window using X. |
|
Back to top |
|
|
Digited
Joined: 30 Oct 2007 Posts: 19
|
Posted: Mon Mar 17, 2008 12:24 pm Post subject: |
|
|
The problem is that gcc's linker "ld" cant link unions from X11. I can and do look at source of gld and c-sdl, but now the first thing is to find out: only I have link errors and crashes with XEvent and other unions from X11 or everybody using latest DMD have too?
simplest code:
import X11.Xlib;
int main( char[][] args )
{
XEvent event; // then try declaring it "static"
XNextEvent( null, &event );
}
does it link and run? (of course, with linking static lib X11) |
|
Back to top |
|
|
Digited
Joined: 30 Oct 2007 Posts: 19
|
|
Back to top |
|
|
|