-1

I am getting an undefined reference error:

/afs/ec.auckland.ac.nz/users/c/s/cshe079/unixhome/Desktop/306P1/ARToolKit/examples/simple/simpleTest.cc:161: undefined reference to `affine_transformation_range::~affine_transformation_range()' collect2: ld returned 1 exit status

I am including the file which has the ~affine_transformation_range() function in it, but it cannot seem to find it. The function itself is empty, which makes it more confusing.

This is the declaration in the function's header:

~affine_transformation_range(void);

This is the function itself:

affine_transformation_range::~affine_transformation_range(void)
{
}
Christian
  • 13
  • 3
  • That is a linker error, not a compiler error. Are you linking against the library that contains the implementation of `affine_transformation_range`? – Bill Aug 24 '11 at 01:27
  • Yes it is in a separate file, and i have an #include to it. Is that what you meant? – Christian Aug 24 '11 at 01:28
  • How do I link a file? Do I need to modify my make file? – Christian Aug 24 '11 at 01:31
  • `#include` tells the compiler to include the header file; telling the linker to link against the library needs to be done separately. Briefly, you use `-L` to tell the linker where to find libraries, and `-l` to give it the name of the library. The documentation for the library *should* give you the details. (Yes, you probably need to modify your Makefile.) – Keith Thompson Aug 24 '11 at 01:34

1 Answers1

2

You're not linking in the translation unit containing:

affine_transformation_range::~affine_transformation_range
ldav1s
  • 15,885
  • 2
  • 53
  • 56