Skip to content

UMat::UMat(commaInitializer) is declared but has no definition/implementation #18879

@diablodale

Description

@diablodale

Hi all. The codebase declares but does not define/implement the UMat constructor for a MatCommaInitializer_ comma initializer.

template<typename _Tp> explicit UMat(const MatCommaInitializer_<_Tp>& commaInitializer);

that has no definition. git blame shows that declaration was added 7 years ago, but I can find no matching definition.
Therefore when code using that constructor is compiled, it results in errors like

error LNK2001: unresolved external symbol "public: __cdecl cv::UMat::UMat<float>(class cv::MatCommaInitializer_<float> const &)" (??$?0M@UMat@cv@@QEAA@AEBV?$MatCommaInitializer_@M@1@@Z)
fatal error LNK1120: 1 unresolved externals
System information (version)
  • OpenCV => 4.5.0
  • Operating System / Platform => Windows 10 64-Bit
  • Compiler => Visual Studio Community 2019 v16.8.2
Steps to reproduce

Create a UMat with a comma initializer like the following...

cv::UMat mymatrix {(cv::Mat_<float>(3, 3) <<
                    1.f, 0.f, 0.f,
                    0.f, 1.f, 0.f,
                    0.f, 0.f, 1.f)};
Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions