R2012a and Microsoft Visual Studio 2012 Pro

조회 수: 2 (최근 30일)
April You
April You 2018년 1월 9일
I have Microsoft Visual Studio 2012 Pro and Matlab R2012b on my computer with Windows7.Pro.x64. I setup compiler configuration of Microsoft Visual Studio 2012 Pro using mex -setup. mex -setup see Microsoft Visual Studio 2012 Pro. I already set the include file in the matlab,but it is also said cannot find the file.here is the pro.
code:
clear all;
% Get the architecture of this computer is_64bit = strcmp(computer,'MACI64') strcmp(computer,'GLNXA64') strcmp(computer,'PCWIN64');
%---------------------------------------------------------------------------------------------- %% The configuration of compiler % You need to modify this configuration according to your own path of OpenCV % Notice: if your system is 64bit, your OpenCV must be 64bit! out_dir='./'; CPPFLAGS = ' -DNDEBUG -I.\ -ID:\ProgramFiles(x86)\opencv\build\include'; % your OpenCV "include" path LDFLAGS = ' -LD:\ProgramFiles(x86)\opencv\build\x86\vc11\lib'; % your OpenCV "lib" path %LIBS = ' -lopencv_calib3d249d -lopencv_contrib249d -lopencv_core249d -lopencv_features2d249d -lopencv_flann249d -lopencv_gpu249d -lopencv_highgui249d -lopencv_imgproc249d -lopencv_legacy249d -lopencv_ml249d -lopencv_nonfree249d -lopencv_objdetect249d -lopencv_photo249d -lopencv_stitching249d -lopencv_ts249d -lopencv_video249d -lopencv_videostab249d'; LIBS = ' -lopencv_calib3d249 -lopencv_contrib249 -lopencv_core249 -lopencv_features2d249 -lopencv_flann249 -lopencv_gpu249 -lopencv_highgui249 -lopencv_imgproc249 -lopencv_legacy249 -lopencv_ml249 -lopencv_nonfree249 -lopencv_objdetect249 -lopencv_photo249 -lopencv_stitching249 -lopencv_ts249 -lopencv_video249 -lopencv_videostab249'; if is_64bit CPPFLAGS = [CPPFLAGS ' -largeArrayDims']; end
% add your files here!! compile_files = { %the list of your code files which need to be compiled % 'ImageCalibration.cpp' 'jiance.cpp' }; %----------------------------------------------------------------------------------------------
%---------------------------------------------------------------------------------------------- %% compiling for k = 1 : length(compile_files) str = compile_files{k}; fprintf('compilation of: %s\n', str); str = [str ' -outdir ' out_dir CPPFLAGS LDFLAGS LIBS]; args = regexp(str, '\s+', 'split'); mex(args{:}); end fprintf('Congratulations, compilation successful!!!\n');
code Error:
compilation of: jiance.cpp
jiance.cpp jiance.cpp(7) : fatal error C1083: cannot open include <file:“opencv2/opencv.hpp”>: No such file or directory
D:\PROGRA~2\MATLAB~1\BIN\MEX.PL: Error: Compile of 'jiance.cpp' failed.

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!