mexopencv icon indicating copy to clipboard operation
mexopencv copied to clipboard

mexopencv not compiling

Open swetha-sree opened this issue 4 years ago • 2 comments

Matlab R2019b Visual Studio Professional 2019 opencv-3.4.1 opencv contrib-3.4.1 Window-10 Cmake-3.16.5

Command mexopencv.make('opencv_path','D:\opencv-3.4.1\build', 'opencv_contrib',true) Here is the stack trace for the same:

Error using mexopencv.make>compiler_str (line 463) Unsupported C++ compiler: Microsoft Visual C++ 2019

Error in mexopencv.make>pkg_config (line 331) L_path = fullfile(opts.opencv_path, arch_str(), compiler_str(), 'lib');

Error in mexopencv.make>mex_options (line 265) [cv_cflags, cv_libs] = pkg_config(opts);

Error in mexopencv.make (line 82) mex_flags = mex_options(opts);

swetha-sree avatar Mar 18 '20 10:03 swetha-sree

Were you able to solve it, I'm also getting Unsupported C++ compiler: Microsoft Visual C++ 2019

ShrivastavaKartik avatar Aug 08 '20 17:08 ShrivastavaKartik

Done one edit to compile it with Visual Studio 2019, in case someone find it useful. Edited the make.m file like following:

            if ~isempty(strfind(cc.Name, 'Visual'))  % Visual Studio
                switch cc.Version
                    case '16.0'           % new code
                        s = 'vc16';        % new code

ShrivastavaKartik avatar Aug 08 '20 18:08 ShrivastavaKartik