Open sandeep-amd opened 1 year ago
@llvm/issue-subscribers-c-1
Usually this is because you have a class (in this case sofa::linearalgebra::FullVector
) for which there is no object file (aka "translation unit") where its vtable is defined: the term for this is a "vtable anchor".
In most cases it can be solved by putting an out-of-line constructor or destructor definition for such a class in one, and only one, .cpp
file.
In this case, constructor definitions exists in the FullVector.h
file.
public:
FullVector()
: linearalgebra::BaseVector()
, data(nullptr), cursize(0), allocsize(0)
{
}
FullVector(const FullVector& vect)
: linearalgebra::BaseVector()
, data(nullptr), cursize(0), allocsize(0)
{
(*this) = vect;
}
So, instead you want me to put it in a .cpp
file ?
Also, the same code builds perfectly with GCC and AOCC(based on llvm 14) without any code changes.
Also, tried with the solution i.e putting an out-of-line constructor definition in the FullVector.cpp
and just keeping declaration in Fullvector.h
. But i still get the same linker issue.
PS: This same code works fine without any changes with AOCC 4.0(based on LLVM 14 compiler).
Hi,
While trying to compile SOFA(https://github.com/sofa-framework/sofa => branch "v23.06") with LLVM 16 , we are getting linker errors as below,
To reproduce this, we have provided a single line command with all the object files attached . The command to reproduce this issue is as below,
We have attached the object files required to reproduce this issue. Please do let us know the solution.
Thanks, Sofa_Obj.tar.gz
Sandeep.