Linking Errors

Denis Golovan denisgolovan at yandex.ru
Wed Jun 18 03:55:09 PDT 2008


Phr00t Wrote:

> Hey all,
> 
> I posted this problem to dsource.org, but I'm not sure how many faces see that
> forum...
> 
> This problem is driving me nuts.. does anyone have any suggestions?
> 
> I get no code warnings / errors in the following code during compilation. I
> can have FU_ITEM and FU_SHIP objects, and I can have dlinkedlists of FU_SHIPs,
> but not of FU_ITEMs as they create linking errors.
> 
> Take the following test code:
> 
> ---------------------------- test.d -----------------
> module test;
> 
> private import arc.templates.dlinkedlist;
> 
> private import classes.item;
> private import classes.ship;
> 
> void main() {
> 
>    FU_ITEM OKItem = new FU_ITEM();
>    FU_SHIP OKShip = new FU_SHIP();
> 
>    dlinkedlist!(FU_ITEM) failItemList = new dlinkedlist!(FU_ITEM);
>    dlinkedlist!(FU_SHIP) OKShipList = new dlinkedlist!(FU_SHIP);
> 
> }
> ------------------------------------------------------------
> 
> It gives these errors on linking:
> 
> ./_test.o: In function `_Dmain':
> test.d:(.text._Dmain+0x25): undefined reference to
> `_D3arc9templates11dlinkedlist40__
> T11dlinkedlistTC7classes4item7FU_ITEMZ11dlinkedlist7__ClassZ'
> test.d:(.text._Dmain+0x30): undefined reference to
> `_D3arc9templates11dlinkedlist40__
> T11dlinkedlistTC7classes4item7FU_ITEMZ11dlinkedlist5_ctorMFZC3arc9templates11dlinkedlist40__T11dlinkedlistTC7classes4item7FU_ITEMZ11dlinkedlist'
> 
> I am using:
> * Ubuntu 8.04
> * dmd v1.0.30
> * GNU ld (GNU Binutils for Ubuntu) 2.18.0.20080103
> * ArcLib's template linked list
> 
> Any ideas? I'd like to continue work on FreeUniverse.. but this has been a
> show-stopper. :(

Well, AFAIU linker cannot find compiled template linked list.
So, maybe command line (makefile) for compilation does not include template linked list compiled object file?

Best regards, Denis


More information about the Digitalmars-d-learn mailing list