May 20, 2013 Re: Compile X Window Manager | ||||
---|---|---|---|---|
| ||||
Posted in reply to Samms | I can really work with the linker, but here it just does not work ... :) That is why I'm asking for such stupid things... |
May 20, 2013 Re: Compile X Window Manager | ||||
---|---|---|---|---|
| ||||
Posted in reply to Samms | On Monday, 20 May 2013 at 03:54:47 UTC, Samms wrote:
> Paths:
>
> import std.c.linux.X11.Xlib;
> import std.c.linux.X11.X;
>
> /usr/include/d2/4.6/std/c/linux/X11
if you do such imports with 3rd party modules you could just add import search location for top level path(which in this case is /usr/include/d2/4.6), then import system find modules by packages path, also with dmd(which is at least uses gcc linker,though i might be wrong on this) you link like this "dmd file.d -L/path/to/lib.a"
p.s. don't blame if this doesn't work for you as i don't use gdc, just dmd and ldc(once or so)
|
May 20, 2013 Re: Compile X Window Manager | ||||
---|---|---|---|---|
| ||||
Posted in reply to evilrat | But why this command: gdc ./main.d -o Refuja -L /usr/include/d2/4.6/std/c/linux/X11/ -l Xlib not work? |
May 20, 2013 Re: Compile X Window Manager | ||||
---|---|---|---|---|
| ||||
Posted in reply to Samms | On Monday, 20 May 2013 at 07:28:42 UTC, Samms wrote:
> But why this command:
>
> gdc ./main.d -o Refuja -L /usr/include/d2/4.6/std/c/linux/X11/ -l Xlib
>
> not work?
i don't know gdc, but dmd is frontend so u work with frontend which pass linker flags with -L, that means if you need to tell linker "-L /some/path" try doing something like this "-L-L/some/path"(single string) or "-LL(or -L-L?) -L/some/path"
may be someone more experienced can tell you the details about gdc linker options.
|
May 20, 2013 Re: Compile X Window Manager | ||||
---|---|---|---|---|
| ||||
Posted in reply to evilrat | Yes - some library working with -L-L - but it not resolve "undefined reference to" Error,... Are you sure, that "undefined reference to" is problem only in linker? |
May 20, 2013 Re: Compile X Window Manager | ||||
---|---|---|---|---|
| ||||
Posted in reply to Samms | 20.05.2013 12:32, Samms пишет:
> I can really work with the linker, but here it just does not work ... :)
> That is why I'm asking for such stupid things...
I didn't use gdc, so I don't know what would I do myself in this situation. :)
didn't using -L-L/path/to/Xlib -L-lXlib help?
|
May 20, 2013 Re: Compile X Window Manager | ||||
---|---|---|---|---|
| ||||
Posted in reply to Samms | On Monday, 20 May 2013 at 08:32:44 UTC, Samms wrote:
> Yes - some library working with -L-L - but it not resolve "undefined reference to" Error,...
>
> Are you sure, that "undefined reference to" is problem only in linker?
yes. just remember if you build lib A which uses lib B and in your app you use lib A you still need link B.
if you use some D lib and it complains about unresolved references there maybe a chance you miss build script for that lib which produces static lib.
so, what exactly you are trying to do?
|
May 20, 2013 Re: Compile X Window Manager | ||||
---|---|---|---|---|
| ||||
Posted in reply to Alexandr Druzhinin Attachments:
| On May 20, 2013 9:45 AM, "Alexandr Druzhinin" <drug2004@bk.ru> wrote: > > 20.05.2013 12:32, Samms пишет: > >> I can really work with the linker, but here it just does not work ... :) That is why I'm asking for such stupid things... > > I didn't use gdc, so I don't know what would I do myself in this situation. :) > didn't using -L-L/path/to/Xlib -L-lXlib help? H'm... gdc uses gcc style switches. So that would be -L/path/to/Xlib -lXlib. Samms, do you have the correct xlib dev packages installed? Regards -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0'; |
May 20, 2013 Re: Compile X Window Manager | ||||
---|---|---|---|---|
| ||||
Posted in reply to Iain Buclaw | 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... "So that would be -L/path/to/Xlib -lXlib." gdc ./main.d -o Refuja -L/usr/include/X11/ -lXlib /usr/bin/ld: cannot find -lXlib collect2: ld returned 1 exit status And last: gdc ./main.d -o Refuja -L-L/usr/include/X11/ -L-lXlib /tmp/ccN5ul41.o: In function `_Dmain': main.d:(.text+0x3f): undefined reference to `XOpenDisplay' main.d:(.text+0x75): undefined reference to `_D3std1c5linux3X114Xlib17DefaultRootWindowFPS3std1c5linux3X114Xlib7DisplayZm' main.d:(.text+0x85): undefined reference to `XStringToKeysym' main.d:(.text+0x9c): undefined reference to `XKeysymToKeycode' main.d:(.text+0xd8): undefined reference to `XGrabKey' main.d:(.text+0xe6): undefined reference to `_D3std1c5linux3X114Xlib17DefaultRootWindowFPS3std1c5linux3X114Xlib7DisplayZm' main.d:(.text+0x155): undefined reference to `XGrabButton' main.d:(.text+0x163): undefined reference to `_D3std1c5linux3X114Xlib17DefaultRootWindowFPS3std1c5linux3X114Xlib7DisplayZm' main.d:(.text+0x1d2): undefined reference to `XGrabButton' main.d:(.text+0x20a): undefined reference to `XNextEvent' main.d:(.text+0x24c): undefined reference to `XRaiseWindow' main.d:(.text+0x29d): undefined reference to `XGetWindowAttributes' main.d:(.text+0x3f2): undefined reference to `XMoveResizeWindow' collect2: ld returned 1 exit status "so, what exactly you are trying to do?" Title this post: "Compile X Window Manager" That I would want to create X Window Manager? |
May 20, 2013 Re: Compile X Window Manager | ||||
---|---|---|---|---|
| ||||
Posted in reply to Samms | 20.05.2013 22:29, Samms пишет:
> 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...
>
> "So that would be -L/path/to/Xlib -lXlib."
>
> gdc ./main.d -o Refuja -L/usr/include/X11/ -lXlib
> /usr/bin/ld: cannot find -lXlib
> collect2: ld returned 1 exit status
>
> And last:
>
> gdc ./main.d -o Refuja -L-L/usr/include/X11/ -L-lXlib
> /tmp/ccN5ul41.o: In function `_Dmain':
> main.d:(.text+0x3f): undefined reference to `XOpenDisplay'
> main.d:(.text+0x75): undefined reference to
> `_D3std1c5linux3X114Xlib17DefaultRootWindowFPS3std1c5linux3X114Xlib7DisplayZm'
>
> main.d:(.text+0x85): undefined reference to `XStringToKeysym'
> main.d:(.text+0x9c): undefined reference to `XKeysymToKeycode'
> main.d:(.text+0xd8): undefined reference to `XGrabKey'
> main.d:(.text+0xe6): undefined reference to
> `_D3std1c5linux3X114Xlib17DefaultRootWindowFPS3std1c5linux3X114Xlib7DisplayZm'
>
> main.d:(.text+0x155): undefined reference to `XGrabButton'
> main.d:(.text+0x163): undefined reference to
> `_D3std1c5linux3X114Xlib17DefaultRootWindowFPS3std1c5linux3X114Xlib7DisplayZm'
>
> main.d:(.text+0x1d2): undefined reference to `XGrabButton'
> main.d:(.text+0x20a): undefined reference to `XNextEvent'
> main.d:(.text+0x24c): undefined reference to `XRaiseWindow'
> main.d:(.text+0x29d): undefined reference to `XGetWindowAttributes'
> main.d:(.text+0x3f2): undefined reference to `XMoveResizeWindow'
> collect2: ld returned 1 exit status
>
> "so, what exactly you are trying to do?"
>
> Title this post: "Compile X Window Manager"
>
> That I would want to create X Window Manager?
You should build Xlib.d also and use correct path to library (your is wrong) like:
gdc ./main.d path/to/Xlib.d -o Refuja -L-L/usr/lib/X11/ -L-lXlib
/usr/include/Xlib point to headers, not to libraries it would be better to use something like above - I'm on windows now, can't say exactly.
|
Copyright © 1999-2021 by the D Language Foundation