LNK1120: 1 unresolved externals and LNK2019: unresolved external symbol

前端 未结 3 552
北海茫月
北海茫月 2021-01-23 12:56

I\'ve been getting these two errors and I cant seem to find a solution that works.

LNK1120: 1 unresolved externals

Error 1 error LNK2019: unresolve

3条回答
  •  既然无缘
    2021-01-23 13:05

    Your implementation of Vector3D appears to be missing an actual implementation for the copy constructor, hence the unresolved external error. If you don't intend the Vector3D object to be copied, you can't pass it into Matrix::operator* by value as that would trigger a copy.

    That said, I don't think there is any reason to declare and implement the copy constructor for Vector3D anyway as it only contains POD types and the compiler generated copy constructor will work fine. The same goes for the destructor, there are no resources to manage so let the compiler do its job.

提交回复
热议问题