newbie confusion with arrays and structs

Robert Bernecky bernecky at snakeisland.com
Thu Jan 26 13:53:39 PST 2012


Awesome! I feel much better now; thank you both for your instant help!

dmd prd.d Array.d -unittest

rbe at rattler:~/plural$ prd
[0]
[0, 1, 2, 3, 4]
Created int
 iota shape is %d
[0]
 iota value is %d
[0, 1, 2, 3, 4]
got to unittest for Array.d
[0]
[0, 1, 2, 3, 4]
Created int
[0]
[0, 1, 2, 3, 4]
rbe at rattler:~/plural$ dmd prd.d Array.d
rbe at rattler:~/plural$ prd
[0]
[0, 1, 2, 3, 4]
Created int
[0]
[0, 1, 2, 3, 4]

I found it odd that the import Array.d in prd.d
was not adequate to bring in Array.d, though...
In the interest of science, I tried this:

ls
Array.d  crud2.d  crud3.d  crud.o   plusSA.d      prddmd    prd.original.d
UnitTestArray.d
Array.o  crud2.o  crud3.o  hello.d  prd.backup.d  prddmd.d  prd.works.d
crud2    crud3    crud.d   plusSA   prd.d         prd.o     UnitTestArray
rbe at rattler:~/plural$ dmd prd.d -I.
prd.o:(.data+0x218): 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

At any rate, I am back on my training wheels again, and thank both Teoh and
Phillips!

ps: Hereafter, I promise to name my modules in lower case.
    Mea culpa and all that!




More information about the Digitalmars-d-learn mailing list