www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Linking Errors

reply Phr00t <phr00t gmail.com> writes:
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. :(
Jun 17 2008
next sibling parent reply Denis Golovan <denisgolovan yandex.ru> writes:
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
Jun 18 2008
parent reply Phr00t <phr00t gmail.com> writes:
Denis Golovan Wrote:

 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
Thank you for your reply. If it did not include the linked list object file, then wouldn't it also complain about this line? dlinkedlist!(FU_SHIP) OKShipList = new dlinkedlist!(FU_SHIP); Because it only complains about FU_ITEM's dlinkedlist :-( - Phr00t
Jun 18 2008
parent reply Fawzi Mohamed <fmohamed mac.com> writes:
On 2008-06-18 14:59:59 +0200, Phr00t <phr00t gmail.com> said:

 Denis Golovan Wrote:
 
 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
Thank you for your reply. If it did not include the linked list object file, then wouldn't it also complain about this line? dlinkedlist!(FU_SHIP) OKShipList = new dlinkedlist!(FU_SHIP); Because it only complains about FU_ITEM's dlinkedlist :-( - Phr00t
- there might be a library or .o file conncted to arc that you have to link In general (not directly connected with your problem) - use dsss to build you stuff (normally it figures out the dependencies) - be careful to to mix phobos/tango librares unless you use tango+tangobos (and even then be careful) Fawzi
Jun 18 2008
parent Phr00t <phr00t gmail.com> writes:
Fawzi Mohamed Wrote:

 On 2008-06-18 14:59:59 +0200, Phr00t <phr00t gmail.com> said:
 
 Denis Golovan Wrote:
 
 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
Thank you for your reply. If it did not include the linked list object file, then wouldn't it also complain about this line? dlinkedlist!(FU_SHIP) OKShipList = new dlinkedlist!(FU_SHIP); Because it only complains about FU_ITEM's dlinkedlist :-( - Phr00t
- there might be a library or .o file conncted to arc that you have to link In general (not directly connected with your problem) - use dsss to build you stuff (normally it figures out the dependencies) - be careful to to mix phobos/tango librares unless you use tango+tangobos (and even then be careful) Fawzi
I am using DSSS + Rebuild to compile this program... (version 0.76 I believe) I'm fully compiling ArcLib v.1 from source, and not linking to any pre-compiled libraries... I'm pretty certain there is no tango or tangobos in my source... purely phobos. I'm wondering if changing that DSSS Rebuild option to do linking "all at once" instead of "one at a time" might fix things...? (I'll give it a try next...) Thank you for your response! - Jeremy
Jun 18 2008
prev sibling parent Denis Golovan <denisgolovan yandex.ru> writes:
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
Jun 18 2008