www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - linker error with timeval static-array

Using v2.0.47, I get a linker error during compilation w/ the following code.

          import time = core.sys.posix.sys.time;

          int
          main( string[] argv )
          {
              time.timeval x[4];    //  <-------- the static array of
timevals is the problem
              return 0;
          }

Execution then yields the following error.

          $ dmd sam/test_timeval.d
          test_timeval.o: In function `_Dmain':
          sam/test_timeval.d:(.text._Dmain+0xa): undefined reference
to `_D4core3sys5posix3sys4time7timeval6__initZ'
          sam/test_timeval.d:(.text._Dmain+0x10): undefined reference
to `_D4core3sys5posix3sys4time7timeval6__initZ'
          collect2: ld returned 1 exit status
          --- errorlevel 1

These code snippets compile normally, though.

          time.timeval x[];
         x = new time.timeval[4];

And this:

          time.timeval x;

So I have a few questions.

(A) how can I demangle the names from the output ?

(B) I am guessing that a ".init" property/function is not defined
properly somewhere.
      where do I begin to investigate this ?  Everything looks OK in
core/sys/posix/sys/time.d

(C)  what IS happening with this ?

Thanks again.

CHICKZ
Jun 23 2010