newbie confusion with arrays and structs

H. S. Teoh hsteoh at
Thu Jan 26 12:40:01 PST 2012

On Thu, Jan 26, 2012 at 08:34:12PM +0000, Robert Bernecky wrote:
> Hi. I am trying to write my first D program, and am quite stuck in several
> areas. This is on Ubuntu 10.10 with the dmd DMD64 D Compiler v2.055.
> However, none of this stuff works. Here's what I get:
> dmd prd.d -unittest
> prd.o:(.data+0x250): undefined reference to `_D5Array12__ModuleInfoZ'
> prd.o:(.data._D23TypeInfo_S5Array6Parray6__initZ+0x28): undefined reference to
> `_D5Array6Parray6__initZ'
> prd.o: In function `_D3prd4iotaFiZPS5Array6Parray':
> prd.d:(.text._D3prd4iotaFiZPS5Array6Parray+0x101): undefined reference to
> `_D5Array6Parray6__ctorMFNcAiAiZS5Array6Parray'
> collect2: ld returned 1 exit status
> --- errorlevel 1
> This is not exactly illuminating, and I have no idea what sort of dumb
> mistake(s) I'm making in the code.

Is Parray defined in another module? If so, you need to include it on
your commandline:

	dmd prd.d parray.d -unittest


There are four kinds of lies: lies, damn lies, and statistics.

More information about the Digitalmars-d-learn mailing list