www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

D.gnu - getUTCtime not working

↑ ↓ ← nick.fletcher dingoblue.com.au writes:
Hi,
i wrote a program in D in win32 (commandline), and it works fine.
then i decided i would try and compile it using the linux port of D from
www.opend.org
it works, but only if i comment out my usage of getUTCtime().
the error message is this:

[root lvs dli-0.1.2]# ./dli passGen.d
passGen.o: In function `__endif_599':
passGen.o(.text+0x30ff): undefined reference to `_D4date_10getUTCtime_FZl'
collect2: ld returned 1 exit status

what im using it for, is to further randomise the random seed when creating the
random number generator.
is there a way i can make getUTCtime() work in linux? or some other time
function i can use that will work? or even some other method of getting a unique
number for the rand_seed() func?
thanks,

Nick
Feb 18 2003
↑ ↓ → Burton Radons <loth users.sourceforge.net> writes:
nick.fletcher dingoblue.com.au wrote:
 Hi,
 i wrote a program in D in win32 (commandline), and it works fine.
 then i decided i would try and compile it using the linux port of D from
 www.opend.org
 it works, but only if i comment out my usage of getUTCtime().
 the error message is this:
 
 [root lvs dli-0.1.2]# ./dli passGen.d
 passGen.o: In function `__endif_599':
 passGen.o(.text+0x30ff): undefined reference to `_D4date_10getUTCtime_FZl'
 collect2: ld returned 1 exit status
 
 what im using it for, is to further randomise the random seed when creating the
 random number generator.
 is there a way i can make getUTCtime() work in linux? or some other time
 function i can use that will work? or even some other method of getting a
unique
 number for the rand_seed() func?

There's the time function, which returns in seconds, and you can open and read from "/dev/random", which is nondeterministic because it samples from the computer state and external input.
Feb 26 2003