Well I'm progressing -slowly

Jesse Phillips jessekphillips at gmail.com
Mon Feb 18 10:46:24 PST 2008


On Mon, 18 Feb 2008 04:31:58 -0500, Ty Tower wrote:

> After analising the command line sent for a small example program I am
> trying to compile I have found that my dmd command is having trouble .
> Probably any one of you could have explained this had you trie a little
> harder .
> 
> Anyway here is the latest output
> 
> [tytower at linuxbox dwt-linux]$ dmd MyStuff/main.d gcc main.o -o main -m32
> -Xlinker -L/usr/bin/../lib -ltango-user-dmd -ltango-base-dmd -lpthread
> -lm /usr/bin/ld: cannot find -lm
> collect2: ld returned 1 exit status
> --- errorlevel 1
> 
> Now all of the libraries are and were there all the time , albeit in
> /usr/lib/  for the majority and in /lib/ for the libm,so.6 which is
> linked to libm-2.4.so.
> 
> In the error noted above however the "ld" cannot find it. Now without
> all the other extraneous b/s of versions etc , surely someone can
> suggest why this might be.
> 
> I have tried copying bth the libm file and link into /usr/lib to no
> avail.
> 
> If it seems like I am rude ,it is because I have been on this ,on and
> off for more than a week and I tend to call bullshit for what it is.

Ty Tower,
I am sorry to say that I do not see how you could be progressing -slowly. 
You see I just looked through all of your other compile errors, and not 
one was having a problem finding -lm. This tells me that instead of 
progressing forward, your doing it backwards.

I do commend you for taking to the time to understand what the linker is 
doing and trying to figure out what you don't understand. (Your post was 
much more concise and polite in d.learn).

To recap:
[tytower at linuxbox import]$ dmd ./test_gridlayout.d
/usr/bin/../src/phobos/std/c/windows/windows.d(12): static assert  is
false

Wrong DWT



dwt/dwtexamples/helloworld/HelloWorld1 -m32 -Xlinker --start-group
-lphobos -lcairo -lglib-2.0 -ldl -lgmodule-2.0 -lgobject-2.0 -lpango-1.0
-lXfixes -lX11 -lXdamage -lXcomposite -lXcursor -lXrandr -lXi -lXinerama
-lXrender -lXext -lXtst -lfontconfig -lpangocairo-1.0 -lgthread-2.0
-lgdk_pixbuf-2.0 -latk-1.0 -lgdk-x11-2.0 -lgtk-x11-2.0 -Xlinker -L./
-Xlinker -L/usr/lib/ -Xlinker -L/usr/lib -Xlinker -L/root/d/lib -Xlinker
-L/usr/bin/../lib -ltango-user-dmd -ltangobos -Xlinker -L/usr/bin/../lib
-ltango-user-dmd -ltangobos -ltango-base-dmd -lpthread -lm
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a
(linux.o).data+0x0):
multiple definition of `MAP_FAILED'
dsss_objs/D/tango.stdc.posix.sys.mman.o.data+0x1c): first defined here
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a
(linux.o).data+0x4):
multiple definition of `FD_SETSIZE'
dsss_objs/D/tango.stdc.posix.sys.select.o.data+0x4): first defined here
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a
(linux.o).data+0xc):
multiple definition of `RTLD_NOW'
dsss_objs/D/tango.stdc.posix.dlfcn.o.data+0x4): first defined here
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a
(linux.o).data+0x10):
multiple definition of `_SIGSET_NWORDS'
dsss_objs/D/tango.stdc.posix.signal.o.data+0x40): first defined here
/usr/bin/ld: cannot find -lXdamage
collect2: ld returned 1 exit status
--- errorlevel 1

conflicting tango and phobos



/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a
(linux.o).data+0x0):
multiple definition of `MAP_FAILED'
dsss_objs/D/tango.stdc.posix.sys.mman.o.data+0x1c): first defined here
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a
(linux.o).data+0x4):
multiple definition of `FD_SETSIZE'
dsss_objs/D/tango.stdc.posix.sys.select.o.data+0x4): first defined here
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a
(linux.o).data+0xc):
multiple definition of `RTLD_NOW'
dsss_objs/D/tango.stdc.posix.dlfcn.o.data+0x4): first defined here
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a
(linux.o).data+0x10):
multiple definition of `_SIGSET_NWORDS'
dsss_objs/D/tango.stdc.posix.signal.o.data+0x40): first defined here
/usr/bin/ld: cannot find -lXdamage
collect2: ld returned 1 exit status

Conflicting tango and Phobos



d/lib -Xlinker -L/usr/bin/../lib -ltango-user-dmd -ltangobos -Xlinker
-L/usr/bin/../lib -ltango-user-dmd -ltangobos -ltango-base-dmd -lpthread
-lm
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a
(linux.o).data+0x0):
multiple definition of `MAP_FAILED'
dsss_objs/D/tango.stdc.posix.sys.mman.o.data+0x1c): first defined here
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a
(linux.o).data+0x4):
multiple definition of `FD_SETSIZE'
dsss_objs/D/tango.stdc.posix.sys.select.o.data+0x4): first defined here
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a
(linux.o).data+0xc):
multiple definition of `RTLD_NOW'
dsss_objs/D/tango.stdc.posix.dlfcn.o.data+0x4): first defined here
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a
(linux.o).data+0x10):
multiple definition of `_SIGSET_NWORDS'
dsss_objs/D/tango.stdc.posix.signal.o.data+0x40): first defined here
/usr/bin/ld: cannot find -lXdamage
collect2: ld returned 1 exit status

Conflicting tango and phobos, yes these end with cannot find -lXdamage, 
on problem can propagate another. (Life of a programmer)



[tytower at linuxbox dwt-linux]$ dmd main.d gcc main.o -o main -m32 -Xlinker
-L/usr/bin/../lib -ltango-user-dmd -ltango-base-dmd -lpthread -lm
main.o.data+0x38): undefined reference to
`_D3dwt7widgets7Display12__ModuleInfoZ' main.o.data+0x3c): undefined
reference to `_D3dwt7widgets5Shell12__ModuleInfoZ' main.o: In function
`_Dmain':
main.d.text._Dmain+0x8): undefined reference to
`_D3dwt7widgets7Display7Display7__ClassZ' main.d.text._Dmain+0x13):
undefined reference to
`_D3dwt7widgets7Display7Display5_ctorMFZC3dwt7widgets7Display7Display'
main.d.text._Dmain+0x1b): undefined reference to
`_D3dwt7widgets5Shell5Shell7__ClassZ' main.d.text._Dmain+0x29):
undefined reference to
`_D3dwt7widgets5Shell5Shell5_ctorMFC3dwt7widgets7Display7DisplayZC3dwt7widgets5Shell5Shell'
collect2: ld returned 1 exit status

Could not find reference to needed libraries, you used dmd instead of 
dsss or rebuild, so the proper -l flags were not added.



[tytower at linuxbox dwt-linux]$ dmd MyStuff/main.d gcc main.o -o main -m32
-Xlinker -L/usr/bin/../lib -ltango-user-dmd -ltango-base-dmd -lpthread -lm
main.o.data+0x38): undefined reference to
`_D3dwt7widgets7Display12__ModuleInfoZ' main.o.data+0x3c): undefined
reference to `_D3dwt7widgets5Shell12__ModuleInfoZ' main.o: In function
`_Dmain':
MyStuff/main.d.text._Dmain+0x8): undefined reference to
`_D3dwt7widgets7Display7Display7__ClassZ'
MyStuff/main.d.text._Dmain+0x13): undefined reference to
`_D3dwt7widgets7Display7Display5_ctorMFZC3dwt7widgets7Display7Display'
MyStuff/main.d.text._Dmain+0x1b): undefined reference to
`_D3dwt7widgets5Shell5Shell7__ClassZ' MyStuff/main.d.text._Dmain+0x29):
undefined reference to
`_D3dwt7widgets5Shell5Shell5_ctorMFC3dwt7widgets7Display7DisplayZC3dwt7widgets5Shell5Shell'
collect2: ld returned 1 exit status

Exactly the same as the last one, no change in operation what-so-ever.



Now had -lm been missing everything would have stopped where you 
currently are stuck. So please don't claim BS, don't disregard are 
statements of improper versions. Surprisingly I'm still willing to help, 
but only if this ignorant bashing of help stops. You may not even want my 
help anymore, but I don't think anyone will be helping you if you 
continue with your current methods.


More information about the Digitalmars-d-dwt mailing list