Compile X Window Manager

Iain Buclaw ibuclaw at ubuntu.com
Mon May 20 09:15:00 PDT 2013


On 20 May 2013 16:29, Samms <matesax at gmail.com> wrote:
> I not have installed Xlib.d - it is overwrite of Xlib.h for D language...
>
>
> "in your app you use lib A you still need link B"
>
> I'm not idiot...
>
>
> "Samms, do you have the correct xlib dev packages installed?"
>
> I'm not idiot...
>

I've RTFM.

http://www.dsource.org/projects/bindings/browser/trunk/X11/README

---
How I use Xlib binding ?
--------------------------


- add "import std.c.linux.Xlib;" to your code.
- use Xlib functions like in C with some minor change:
this bindings is more strongly typed than C version,it use D features
when it can.

so instead of writing:
    GC gc=XCreateGC(display,window,GCForeground | GCBackground,&values);
you while need to write:
    GC gc=XCreateGC(display,window,GCMask.GCForeground |
GCMask.GCBackground,&values);

For example you will compile your code like this if you're using dmd:
    dmd yourfile.d Xlib.d X.d  -L-lX11 (don't forget -L-lX11 ;) )

For a complete example read example.d
---

So... s/dmd/gdc and you get:

gdc yourfile.d Xlib.d X.d -lX11



--
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the D.gnu mailing list