www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - DMD on linux?

reply Sean Eskapp <eatingstaples gmail.com> writes:
I'm trying to work with D on Ubuntu, but I keep having this issue:

...
function  func
function  func
gcc Nullimorphism.o -o Nullimorphism.exe -g -m32 -l -Xlinker
-L/usr/bin/../lib32 -Xlinker -
L/usr/bin/../lib64 -Xlinker --no-warn-search-mismatch -Xlinker --export-dynamic
-lrt -
lphobos2 -lpthread -lm
/usr/bin/ld: cannot find -l-Xlinker
/usr/bin/ld: cannot find -lphobos2
collect2: ld returned 1 exit status
--- errorlevel 1
make[1]: *** [all] Error 1
...

I downloaded the DMD v2.052 ZIP from the download page, extracted the linux/bin
folder into
/usr/bin, the linux/lib64 folder into /usr/lib64, and the src folder into
/usr/src. Can
somebody please help?
Mar 02 2011
next sibling parent reply Jonathan M Davis <jmdavisProg gmx.com> writes:
On Wednesday, March 02, 2011 13:52:29 Sean Eskapp wrote:
 I'm trying to work with D on Ubuntu, but I keep having this issue:
 
 ...
 function  func
 function  func
 gcc Nullimorphism.o -o Nullimorphism.exe -g -m32 -l -Xlinker
 -L/usr/bin/../lib32 -Xlinker - L/usr/bin/../lib64 -Xlinker
 --no-warn-search-mismatch -Xlinker --export-dynamic -lrt - lphobos2
 -lpthread -lm
 /usr/bin/ld: cannot find -l-Xlinker
 /usr/bin/ld: cannot find -lphobos2
 collect2: ld returned 1 exit status
 --- errorlevel 1
 make[1]: *** [all] Error 1
 ...
 
 I downloaded the DMD v2.052 ZIP from the download page, extracted the
 linux/bin folder into /usr/bin, the linux/lib64 folder into /usr/lib64,
 and the src folder into /usr/src. Can somebody please help?
1. I never bother installing the zip anywhere. If you just unzip it and add /path/to/unzipped/dmd2/linux/bin to your path, then you should be fine. I don't see any real reason to actual try and install dmd into your system folders (though you obviously can if you want to). 2. Assuming that you _do_ move files around, you need to adjust your dmd.conf so that it points to the appropriate places. 3. If you just moved files around, then you might not _have_ a dmd.conf, and you're doubly screwed. Take a look at the documentation page for dmd on linux: http://www.digitalmars.com/d/2.0/dmd-linux.html It's slightly out of date, since with the last release, 64-bit support was added, and the 32-bit version of libphobos.a is in /path/to/unzipped/dmd2/linux/lib32 and the 64-bit version is in /path/to/unzipped/dmd2/linux/lib64, but the instructions should be correct otherwise. You need to make sure that dmd is on your path and that a version of dmd.conf which points to the place where libphobos2.a is is in one of the places that dmd looks for dmd.conf (as described on that page). Also, make sure that you're using a dmd.conf based on the most recent version, or you could be missing necessary linker flags. - Jonathan M Davis
Mar 02 2011
parent reply Sean Eskapp <eatingstaples gmail.com> writes:
== Quote from Jonathan M Davis (jmdavisProg gmx.com)'s article
 On Wednesday, March 02, 2011 13:52:29 Sean Eskapp wrote:
 I'm trying to work with D on Ubuntu, but I keep having this
issue:
 ...
 function  func
 function  func
 gcc Nullimorphism.o -o Nullimorphism.exe -g -m32 -l -Xlinker
 -L/usr/bin/../lib32 -Xlinker - L/usr/bin/../lib64 -Xlinker
 --no-warn-search-mismatch -Xlinker --export-dynamic -lrt -
lphobos2
 -lpthread -lm
 /usr/bin/ld: cannot find -l-Xlinker
 /usr/bin/ld: cannot find -lphobos2
 collect2: ld returned 1 exit status
 --- errorlevel 1
 make[1]: *** [all] Error 1
 ...

 I downloaded the DMD v2.052 ZIP from the download page,
extracted the
 linux/bin folder into /usr/bin, the linux/lib64 folder into
/usr/lib64,
 and the src folder into /usr/src. Can somebody please help?
1. I never bother installing the zip anywhere. If you just unzip
it and add
 /path/to/unzipped/dmd2/linux/bin to your path, then you should be
fine. I don't
 see any real reason to actual try and install dmd into your system
folders
 (though you obviously can if you want to).
 2. Assuming that you _do_ move files around, you need to adjust
your dmd.conf so
 that it points to the appropriate places.
 3. If you just moved files around, then you might not _have_ a
dmd.conf, and
 you're doubly screwed.
 Take a look at the documentation page for dmd on linux:
 http://www.digitalmars.com/d/2.0/dmd-linux.html
 It's slightly out of date, since with the last release, 64-bit
support was
 added, and the 32-bit version of libphobos.a is in
 /path/to/unzipped/dmd2/linux/lib32 and the 64-bit version is in
 /path/to/unzipped/dmd2/linux/lib64, but the instructions should be
correct
 otherwise.
 You need to make sure that dmd is on your path and that a version
of dmd.conf
 which points to the place where libphobos2.a is is in one of the
places that dmd
 looks for dmd.conf (as described on that page). Also, make sure
that you're
 using a dmd.conf based on the most recent version, or you could be
missing
 necessary linker flags.
 - Jonathan M Davis
Hmm my dmd.conf seems fine, but since the .deb has been updated, I can just use that. Thanks!
Mar 02 2011
parent reply Sean Eskapp <eatingstaples gmail.com> writes:
I'm still having issues with the linux dmd. Here's the relevant part
of the output:

...
function  func
function  func
gcc Nullimorphism.o -o Nullimorphism.exe -g -m32 -l -Xlinker -
L/usr/lib32 -Xlinker -L/usr/lib64 -Xlinker --no-warn-search-mismatch
-Xlinker --export-dynamic -lrt -lphobos2 -lpthread -lm
/usr/bin/ld: cannot find -l-Xlinker
collect2: ld returned 1 exit status
--- errorlevel 1
make[1]: *** [all] Error 1
make[1]: Leaving directory
...

Any help is appreciated.
Mar 02 2011
next sibling parent reply Jesse Phillips <jessekphillips+D gmail.com> writes:
Sean Eskapp Wrote:

 I'm still having issues with the linux dmd. Here's the relevant part
 of the output:
 
 ...
 function  func
 function  func
 gcc Nullimorphism.o -o Nullimorphism.exe -g -m32 -l -Xlinker -
 L/usr/lib32 -Xlinker -L/usr/lib64 -Xlinker --no-warn-search-mismatch
 -Xlinker --export-dynamic -lrt -lphobos2 -lpthread -lm
 /usr/bin/ld: cannot find -l-Xlinker
 collect2: ld returned 1 exit status
 --- errorlevel 1
 make[1]: *** [all] Error 1
 make[1]: Leaving directory
 ...
 
 Any help is appreciated.
I think the part LD is tripping up on is "-m32 -l -Xlinker" So it seems you are calling dmd incorrectly or modified dmd.conf incorrectly as there is no argument after -l so LD thinks you want to link against lib-Xlinker.
Mar 02 2011
parent Sean Eskapp <eatingstaples gmail.com> writes:
== Quote from Jesse Phillips (jessekphillips+D gmail.com)'s article
 Sean Eskapp Wrote:
 I'm still having issues with the linux dmd. Here's the relevant
part
 of the output:

 ...
 function  func
 function  func
 gcc Nullimorphism.o -o Nullimorphism.exe -g -m32 -l -Xlinker -
 L/usr/lib32 -Xlinker -L/usr/lib64 -Xlinker --no-warn-search-
mismatch
 -Xlinker --export-dynamic -lrt -lphobos2 -lpthread -lm
 /usr/bin/ld: cannot find -l-Xlinker
 collect2: ld returned 1 exit status
 --- errorlevel 1
 make[1]: *** [all] Error 1
 make[1]: Leaving directory
 ...

 Any help is appreciated.
I think the part LD is tripping up on is "-m32 -l -Xlinker" So it seems you are calling dmd incorrectly or modified dmd.conf
incorrectly as there is no argument after -l so LD thinks you want to link against lib-Xlinker. Oops yeah, there was some obsolete in the makefile in my project. Don't know how it managed to compile on windows, though.. Thanks, though, problem solved.
Mar 03 2011
prev sibling parent Jacob Carlborg <doob me.com> writes:
On 2011-03-03 00:43, Sean Eskapp wrote:
 I'm still having issues with the linux dmd. Here's the relevant part
 of the output:

 ...
 function  func
 function  func
 gcc Nullimorphism.o -o Nullimorphism.exe -g -m32 -l -Xlinker -
 L/usr/lib32 -Xlinker -L/usr/lib64 -Xlinker --no-warn-search-mismatch
 -Xlinker --export-dynamic -lrt -lphobos2 -lpthread -lm
 /usr/bin/ld: cannot find -l-Xlinker
 collect2: ld returned 1 exit status
 --- errorlevel 1
 make[1]: *** [all] Error 1
 make[1]: Leaving directory
 ...

 Any help is appreciated.
You can give this a try: https://bitbucket.org/doob/dvm/wiki/Home -- /Jacob Carlborg
Mar 02 2011
prev sibling parent Robert Clipsham <robert octarineparrot.com> writes:
On 02/03/11 21:52, Sean Eskapp wrote:
 I'm trying to work with D on Ubuntu, but I keep having this issue:

 ...
 function  func
 function  func
 gcc Nullimorphism.o -o Nullimorphism.exe -g -m32 -l -Xlinker
-L/usr/bin/../lib32 -Xlinker -
 L/usr/bin/../lib64 -Xlinker --no-warn-search-mismatch -Xlinker
--export-dynamic -lrt -
 lphobos2 -lpthread -lm
 /usr/bin/ld: cannot find -l-Xlinker
 /usr/bin/ld: cannot find -lphobos2
 collect2: ld returned 1 exit status
 --- errorlevel 1
 make[1]: *** [all] Error 1
 ...

 I downloaded the DMD v2.052 ZIP from the download page, extracted the
linux/bin folder into
 /usr/bin, the linux/lib64 folder into /usr/lib64, and the src folder into
/usr/src. Can
 somebody please help?
See also: http://ftp.digitalmars.com/dmd_2.052-0_i386.deb for everything to work out of the box. -- Robert http://octarineparrot.com/
Mar 02 2011