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._D4core4time12TickDuration14currSystemTickFNdNeZS4core4time12TickDuration +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. -Lars
