I am trying to compile large C++ project and I am getting this strange error. I know that it is linking error but couldn’t figure out what it is exactly.
test_oqlquery.o:(.rodata._ZTV8r_MarrayIhE[vtable for r_Marray]+0x8): undefined reference to r_Marray<unsigned char>::~r_Marray()'
test_oqlquery.o:(.rodata._ZTV8r_MarrayIhE[vtable for r_Marray<unsigned char>]+0xc): undefined reference tor_Marray::~r_Marray()'
test_oqlquery.o:(.rodata._ZTV8r_MarrayIhE[vtable for r_Marray]+0x28): undefined reference to `r_Marray::print_status(std::basic_ostream >&) const'
What does this error mean ? And, is it possible to see the line number where there error is happening ? How ? I am mainly concerned with what this means
".rodata._ZTV8r_MarrayIhE[vtable for r_Marray]+0x28"
Actually, my error is like this, but dont know why everything inside angle bracket are missing, so replacing them with " ", here is detailed error, it has something to do with template instantiation, as well
test_oqlquery.o:(.rodata._ZTV8r_MarrayIhE[vtable for r_Marray"unsigned char"]+0x8): undefined reference to `r_Marray"unsigned char"::~r_Marray()'
I am using g++ 4.3.3.
Please excuse me, I cannot submit the whole source code here as it is very large and spans over multiple directories.
Thanks a lot.
First, linker errors and compiler errors are different things. Since linker deals with object files rather than source files, compiler errors have a line number but linker errors don’t.
Second, it seems that you have declared the destructor for r_Marray but have not implemented it anywhere included in the build. The same thing goes for print_status.