www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - rawRead linker error

Hello all,

I'm trying to read from /dev/random using File.rawRead as follows:

     auto f = File("/dev/urandom", "r");
     ulong b;
     f.rawRead((&b)[0 .. 1]);

This generates a linker error:

rawread.o: In function `_D3std5stdio4File14__T7rawReadTmZ7rawReadMFAmZAm':
undefined reference to 
collect2: error: ld returned 1 exit status
--- errorlevel 1

Can anyone advise what's the problem here?  Passing a regular array as the 
buffer doesn't cause any issues, but I can't see what's wrong with passing a 
slice based around pointer-to-ulong as in the above example.

This certainly _used_ to work, so I take it it's down to a recent change to 
rawRead ... ?

Thanks and best wishes,

     -- Joe
Jun 01 2014