internal compiler error in module wrapping opencv cv::mat

M3 116 Reputation points
2021-11-12T22:14:09.773+00:00

I get internal compiler error trying to compile this module.ixx file. I have tried variations on this and can sometimes get the module to compile, but the external program referencing this module then fails to compile with internal compiler error. Therefore, I'm just showing simpler example. What I'm trying to do is thinly wrap the cv::Mat to shield referencing programs from changes I may want to make.

I'm using /std::c++lateset and scan sources for module dependencies to yes, using VS 2022 current. OpenCV was integrated into the project using vcpkg and is release 4.5.3#3. I've also seen internal compiler errors in similar situations with Boost geometry.

module;

export module Module;
import<opencv2\core\core.hpp>;
import<opencv2\imgproc.hpp>;

namespace m3 {
export {
    auto test_mat() {
        int height = 10;
        int width = 10;

        return cv::Mat(height, width, CV_8UC1);
    }
}
}  // namespace m3
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,849 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.