'Undefined reference' linking errors

Ali Çehreli acehreli at yahoo.com
Wed Apr 7 13:57:36 PDT 2010


Joseph Wakeling wrote:

 >         void opCall(ref rating[] ratings,
 >                     ref double[] reputation_user,
 >                     ref double[] reputation_object);

The errors are for the missing definitions of that function. Either 
provide a definition, or just remove that declaration. (Remove the 
declaration if you just want to create an object below.

 >  avg_weighted(ratings,reputation_user,reputation_object);

If you want to create an object of avg_weighted:

  auto aw = new avg_weighted(ratings,reputation_user,reputation_object);

 > test.o:(.rodata+0x98): undefined reference to
 > `_D5dregs3avg12avg_weighted6opCallMFKAS5dregs10reputation6ratingKAdKAdZv'
 > test.o:(.rodata+0xf8): undefined reference to

I wonder how you missed the "opCall" in there! :p

Ali


More information about the Digitalmars-d-learn mailing list