DMD 2.0562

Jonathan M Davis jmdavisProg at gmx.com
Fri Feb 18 10:31:59 PST 2011


On Friday, February 18, 2011 09:41:07 Lars T. Kyllingstad wrote:
> On Fri, 18 Feb 2011 15:26:20 +0000, Russel Winder wrote:
> > I had thought std.date was deprecated, it actually seems to have been
> > decimated?  Actually it seems to be trying to use datetime anyway?
> > 
> > |> dmd -I. -O -release -inline -m64 -c -ofpi_d2_sequential.o
> > 
> > pi_d2_sequential.d std.date and std.dateparse have been scheduled for
> > deprecation. Please use std.datetime instead.
> > 
> > |> gcc -o pi_d2_sequential pi_d2_sequential.o
> > 
> > -L/home/users/russel/lib.Linux.x86_64/DMD2/lib64 -lphobos2 -lpthread -lm
> > /home/users/russel/lib.Linux.x86_64/DMD2/lib64/libphobos2.a
> 
> (datetime_434_1ec.o):
> > In function `_D3std8datetime5Clock11currStdTimeFNdNeZl':
> > std/datetime.d:(.text._D3std8datetime5Clock11currStdTimeFNdNeZl+0x1d):
> > undefined reference to `clock_gettime'
> > /home/users/russel/lib.Linux.x86_64/DMD2/lib64/libphobos2.a
> 
> (time_10e_4d1.o):
> > In function `_D4core4time12TickDuration12_staticCtor7OFNeZv':
> > src/core/time.d:(.text._D4core4time12TickDuration12_staticCtor7OFNeZv
> 
> +0x1f):
> > undefined reference to `clock_getres'
> > /home/users/russel/lib.Linux.x86_64/DMD2/lib64/libphobos2.a
> 
> (time_10e_4d1.o):
> > In function
> 
> `_D4core4time12TickDuration14currSystemTickFNdNeZS4core4time12TickDuration':
> > src/core/time.d:
> (.text._D4core4time12TickDuration14currSystemTickFNdNeZS4core4time12TickDur
> ation
> 
> +0x1f):
> > undefined reference to `clock_gettime' collect2: ld returned 1 exit
> > status
> 
> You need to link in librt.  Pass the -L-lrt option to DMD (or -lrt to
> GCC), and you get rid of the "undefined reference" errors.

Yeah. Make sure that your dmd.conf is up-to-date. There are a number of changes 
in it with the most recent release - not only the addition of librt, but the lib 
directories were changed as well. So, everyone should either use the dmd.conf 
that comes in the release or make sure that the dmd.conf that they use is based 
on that dmd.conf. You're going to run into problems otherwise.

- Jonathan M Davis


More information about the Digitalmars-d mailing list