datetime fails with undefined reference

Kai Meyer kai at fiber.net
Fri Feb 18 08:13:45 PST 2011


I can import std.datetime, but when I try to use Ticks, or build the unittest,
I get undefined reference issues with the Posix time libraries.

Fedora 14, dmd-2.051-0.i386.rpm
[kai at worky ~]$ dmd -unittest /usr/include/d/dmd/phobos/std/datetime.d
datetime.o: In function `_D3std8datetime5Ticks12_staticCtor1OFNeZv':
/usr/include/d/dmd/phobos/std/datetime.d:(.text._D3std8datetime5Ticks12_staticCtor1OFNeZv+0x14):
undefined reference to `clock_getres'
datetime.o: In function `_D3std8datetime7systimeFNeZS3std8datetime5Ticks':
/usr/include/d/dmd/phobos/std/datetime.d:(.text._D3std8datetime7systimeFNeZS3std8datetime5Ticks+0x14):
undefined reference to `clock_gettime'
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib/libphobos2.a(dmain2_517_1a5.o):
In function `_D2rt6dmain24mainUiPPaZi7runMainMFZv':
src/rt/dmain2.d:(.text._D2rt6dmain24mainUiPPaZi7runMainMFZv+0x16): undefined
reference to `_Dmain'
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib/libphobos2.a(deh2_4e7_525.o):
In function `_D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable':
src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0x4):
undefined reference to `_deh_beg'
src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0xc):
undefined reference to `_deh_beg'
src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0x13):
undefined reference to `_deh_end'
src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0x37):
undefined reference to `_deh_end'
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib/libphobos2.a(thread_eb_258.o):
In function `_D4core6thread6Thread6__ctorMFZC4core6thread6Thread':
src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFZC4core6thread6Thread+0x1d):
undefined reference to `_tlsend'
src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFZC4core6thread6Thread+0x24):
undefined reference to `_tlsstart'
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib/libphobos2.a(thread_ee_6e4.o):
In function `thread_attachThis':
src/core/thread.d:(.text.thread_attachThis+0x53): undefined reference to
`_tlsstart'
src/core/thread.d:(.text.thread_attachThis+0x5c): undefined reference to `_tlsend'
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib/libphobos2.a(thread_e8_713.o):
In function `thread_entryPoint':
src/core/thread.d:(.text.thread_entryPoint+0x29): undefined reference to `_tlsend'
src/core/thread.d:(.text.thread_entryPoint+0x2f): undefined reference to
`_tlsstart'
collect2: ld returned 1 exit status
--- errorlevel 1


More information about the Digitalmars-d-bugs mailing list