dmd2 on Ubuntu
Jonathan M Davis
jmdavisProg at gmx.com
Fri May 6 15:25:48 PDT 2011
> Hello all,
>
> It's been a while since I've worked with D, but I'm coming back to it now
> since it has 64 bit support for Windows, Linux and Mac. I'm developing on
> 64 bit Ubuntu. Here's the output of uname -a:
>
> Linux jetty 2.6.32-31-generic #61-Ubuntu SMP Fri Apr 8 18:25:51 UTC 2011
> x86_64 GNU/Linux
>
> I've done a partial installation leaving the source libraries in my user
> directory, but moving phobos and the executables to /usr/local/bin and
> /usr/lib. dmd seems to run fine. I was able to compile some old projects I
> had into libraries. Now I'm trying to build the executable to use them.
> When I issue:
>
> dmd -ofbin/Debug/d_txtflt obj/Debug/d_txtflt.o
> ../d_libcsv/bin/Debug/libd_libcsv.a
> ../strptime/internalDate/bin/Debug/libinternalDate.a
>
> I get /usr/bin/ld: cannot find -lphobos2. Here is the contents of my
> dmd.conf file which is in /etc:
>
> [Environment]
>
> DFLAGS=-I/home/tarka/dmd2/src/phobos -I/home/tarka/dmd2/src/druntime/import
> -L-L/usr/lib -L--no-warn-search-mismatch -L-- export-dynamic -L-lrt
>
> The compilation seems to work fine; it's the link that fails. When I tried
> to run ld directly with:
>
> ld -o bin/Debug/d_txtflt obj/Debug/d_txtflt.o -l
> :../strptime/internalDate/bin/libinternalDate.a -l
> :../d_libcsv/bin/Debug/libd_libcsv.a -l
>
> :/usr/lib/libphobos2.a -E -lrt -lc
>
> I get a warning:
>
> ld: warning: cannot find entry symbol _start; defaulting to
> 00000000004562d0
>
> But it does generate output that the file commands claims is a 64 bit
> executable. The file will not run however.
>
> Any ideas what's going on here?
>
> Thanx
>
> Brian
Personally, I'd advise to not even try "installing" dmd. I'd suggest that you
simply unzip the dmd zip file somewhere in your home directory and then add
/path/to/unzipped/dmd2/linux/bin to your PATH. That generally works great. It
makes it incredibly easy to swap it out when a new version is released, and
you don't really have to worry about setting it up correctly.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list